Add concurrency checks for unit tests, build and quality checks.

This commit is contained in:
David Langley 2022-02-23 18:11:46 +00:00
parent 5bbd6769b9
commit 639774662a
4 changed files with 30 additions and 1 deletions

View File

@ -15,6 +15,11 @@ jobs:
debug: debug:
name: Build debug APKs (${{ matrix.target }}) name: Build debug APKs (${{ matrix.target }})
runs-on: ubuntu-latest runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('build-debug-develop-{0}', github.sha) || format('build-debug-{0}', github.ref) }}
cancel-in-progress: true
if: github.ref != 'refs/heads/main' if: github.ref != 'refs/heads/main'
strategy: strategy:
fail-fast: false fail-fast: false
@ -42,6 +47,11 @@ jobs:
release: release:
name: Build unsigned GPlay APKs name: Build unsigned GPlay APKs
runs-on: ubuntu-latest runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('build-release-develop-{0}', github.sha) || format('build-release-{0}', github.ref) }}
cancel-in-progress: true
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -1,4 +1,3 @@
# no-op
name: Integration Tests name: Integration Tests
on: on:

View File

@ -18,6 +18,11 @@ jobs:
ktlint: ktlint:
name: Kotlin Linter name: Kotlin Linter
runs-on: ubuntu-latest runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('ktlint-develop-{0}', github.sha) || format('ktlint-{0}', github.ref) }}
cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Run ktlint - name: Run ktlint
@ -87,6 +92,11 @@ jobs:
android-lint: android-lint:
name: Android Linter name: Android Linter
runs-on: ubuntu-latest runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('android-lint-develop-{0}', github.sha) || format('android-lint-{0}', github.ref) }}
cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/cache@v2 - uses: actions/cache@v2
@ -111,6 +121,11 @@ jobs:
apk-lint: apk-lint:
name: Lint APK (${{ matrix.target }}) name: Lint APK (${{ matrix.target }})
runs-on: ubuntu-latest runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('apk-lint-develop-{0}', github.sha) || format('apk-lint-{0}', github.ref) }}
cancel-in-progress: true
if: github.ref != 'refs/heads/main' if: github.ref != 'refs/heads/main'
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -15,6 +15,11 @@ jobs:
unit-tests: unit-tests:
name: Run Unit Tests name: Run Unit Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('test-unit-develop-{0}', github.sha) || format('test-unit-{0}', github.ref) }}
cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/cache@v2 - uses: actions/cache@v2