Use matrix.target to fix build group. Use env vars to clean up.

This commit is contained in:
David Langley 2022-02-23 22:16:24 +00:00
parent edb92f85c5
commit 43c125ed32
4 changed files with 27 additions and 30 deletions

View file

@ -10,15 +10,16 @@ env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
CI_ANY_MAIN: ${{ github.ref == 'refs/heads/main' && format('main-{0}', github.sha) }}
CI_ANY_DEVELOP: ${{ github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) }}
CI_ONE_PR: ${{ format('build-debug-{0}-{1}', matrix.target, github.ref) }}
CI_GROUP_SUFFIX: ${{ CI_ANY_MAIN || CI_ANY_DEVELOP || CI_ONE_PR }}
jobs:
debug:
name: Build debug APKs (${{ matrix.target }})
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) }}
group: ${{ format('build-debug-{0}-{1}', matrix.target, CI_GROUP_SUFFIX) }}
cancel-in-progress: true
if: github.ref != 'refs/heads/main'
strategy:
@ -48,9 +49,7 @@ jobs:
name: Build unsigned GPlay APKs
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) }}
group: ${{ format('build-release-{0}-{1}', matrix.target, CI_GROUP_SUFFIX) }}
cancel-in-progress: true
if: github.ref == 'refs/heads/main'
steps:

View file

@ -1,4 +1,3 @@
# no-op
name: Integration Tests
on:
@ -11,6 +10,10 @@ env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
CI_ANY_MAIN: ${{ github.ref == 'refs/heads/main' && format('main-{0}', github.sha) }}
CI_ANY_DEVELOP: ${{ github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) }}
CI_ONE_PR: ${{ format('build-debug-{0}-{1}', matrix.target, github.ref) }}
CI_GROUP_SUFFIX: ${{ CI_ANY_MAIN || CI_ANY_DEVELOP || CI_ONE_PR }}
jobs:
# Build Android Tests [Matrix SDK]
@ -18,9 +21,7 @@ jobs:
name: Matrix SDK - Build Android Tests
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-matrix-sdk-develop-{0}', github.sha) || format('test-matrix-sdk-{0}', github.ref) }}
group: ${{ format('test-matrix-sdk-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -40,9 +41,7 @@ jobs:
name: App - Build Android Tests
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-app-develop-{0}', github.sha) || format('test-app-{0}', github.ref) }}
group: ${{ format('test-app-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -62,9 +61,7 @@ jobs:
name: Matrix SDK - Running Integration Tests
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('integration-tests-develop-{0}', github.sha) || format('integration-tests-{0}', github.ref) }}
group: ${{ format('integration-tests-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
strategy:
fail-fast: false

View file

@ -5,6 +5,12 @@ on:
push:
branches: [ main, develop ]
env:
CI_ANY_MAIN: ${{ github.ref == 'refs/heads/main' && format('main-{0}', github.sha) }}
CI_ANY_DEVELOP: ${{ github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) }}
CI_ONE_PR: ${{ format('build-debug-{0}-{1}', matrix.target, github.ref) }}
CI_GROUP_SUFFIX: ${{ CI_ANY_MAIN || CI_ANY_DEVELOP || CI_ONE_PR }}
jobs:
check:
name: Project Check Suite
@ -19,9 +25,7 @@ jobs:
name: Kotlin Linter
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) }}
group: ${{ format('klint-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -93,9 +97,7 @@ jobs:
name: Android Linter
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) }}
group: ${{ format('android-lint-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -122,9 +124,7 @@ jobs:
name: Lint APK (${{ matrix.target }})
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) }}
group: ${{ format('apk-lint-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
if: github.ref != 'refs/heads/main'
strategy:

View file

@ -10,15 +10,16 @@ env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
CI_ANY_MAIN: ${{ github.ref == 'refs/heads/main' && format('main-{0}', github.sha) }}
CI_ANY_DEVELOP: ${{ github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) }}
CI_ONE_PR: ${{ format('build-debug-{0}-{1}', matrix.target, github.ref) }}
CI_GROUP_SUFFIX: ${{ CI_ANY_MAIN || CI_ANY_DEVELOP || CI_ONE_PR }}
jobs:
unit-tests:
name: Run Unit Tests
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) }}
group: ${{ format('unit-tests-{0}', CI_GROUP_SUFFIX) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2