Merge pull request #5328 from vector-im/feature/dla/ci_check_concurrency

Add concurrency to the GitHub workflows to auto-cancel older runs of actions in PRs.
This commit is contained in:
Benoit Marty 2022-02-28 14:20:30 +01:00 committed by GitHub
commit d5cb315ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 15 deletions

View File

@ -20,6 +20,10 @@ jobs:
fail-fast: false
matrix:
target: [ Gplay, Fdroid ]
# Allow all jobs on develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}-{1}', matrix.target, github.sha) || format('build-debug-{0}-{1}', matrix.target, github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
@ -43,6 +47,7 @@ jobs:
name: Build unsigned GPlay APKs
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
# Only runs on main, no concurrency.
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2

View File

@ -5,6 +5,7 @@ jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
# No concurrency required, this is a prerequisite to other actions and should run every time.
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

View File

@ -20,6 +20,7 @@ jobs:
build-android-test-matrix-sdk:
name: Matrix SDK - Build Android Tests
runs-on: macos-latest
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
@ -37,6 +38,7 @@ jobs:
build-android-test-app:
name: App - Build Android Tests
runs-on: macos-latest
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
@ -58,6 +60,7 @@ jobs:
fail-fast: false
matrix:
api-level: [ 28 ]
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
@ -193,6 +196,7 @@ jobs:
fail-fast: false
matrix:
api-level: [ 28 ]
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
with:
@ -249,6 +253,7 @@ jobs:
- integration-tests
- ui-tests
if: always()
# No concurrency required, runs every time on a schedule.
steps:
- uses: michaelkaye/matrix-hookshot-action@v0.2.0
with:

View File

@ -18,6 +18,10 @@ jobs:
ktlint:
name: Kotlin Linter
runs-on: ubuntu-latest
# Allow all jobs on main and develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('ktlint-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('ktlint-develop-{0}', github.sha) || format('ktlint-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- name: Run ktlint
@ -87,6 +91,10 @@ jobs:
android-lint:
name: Android Linter
runs-on: ubuntu-latest
# Allow all jobs on main and develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('android-lint-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('android-lint-develop-{0}', github.sha) || format('android-lint-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
@ -116,6 +124,10 @@ jobs:
fail-fast: false
matrix:
target: [ Gplay, Fdroid ]
# Allow all jobs on develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('apk-lint-develop-{0}-{1}', matrix.target, github.sha) || format('apk-lint-{0}-{1}', matrix.target, github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2

View File

@ -9,6 +9,7 @@ jobs:
runs-on: ubuntu-latest
# Skip in forks
if: github.repository == 'vector-im/element-android'
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
@ -35,6 +36,7 @@ jobs:
runs-on: ubuntu-latest
# Skip in forks
if: github.repository == 'vector-im/element-android'
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
@ -60,6 +62,7 @@ jobs:
runs-on: ubuntu-latest
# Skip in forks
if: github.repository == 'vector-im/element-android'
# No concurrency required, runs every time on a schedule.
steps:
- uses: actions/checkout@v2
- name: Run analytics import script

View File

@ -15,6 +15,10 @@ jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
# Allow all jobs on main and develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2