Have to inline it as can't use env vars in other env vars.

This commit is contained in:
David Langley 2022-02-23 22:58:51 +00:00
parent 355931a592
commit cf7417d544
4 changed files with 12 additions and 41 deletions

View file

@ -10,24 +10,18 @@ env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
CI_GROUP_SUFFIX: >
${{
github.ref == 'refs/heads/main' && format('main-{0}', github.sha) ||
github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) ||
github.ref
}}
jobs:
debug:
name: Build debug APKs (${{ matrix.target }})
runs-on: ubuntu-latest
concurrency:
group: ${{ format('build-debug-{0}-{1}', matrix.target, env.CI_GROUP_SUFFIX) }}
cancel-in-progress: true
if: github.ref != 'refs/heads/main'
strategy:
fail-fast: false
matrix:
target: [ Gplay, Fdroid ]
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
@ -50,9 +44,6 @@ jobs:
release:
name: Build unsigned GPlay APKs
runs-on: ubuntu-latest
concurrency:
group: ${{ format('build-release-{0}-{1}', matrix.target, env.CI_GROUP_SUFFIX) }}
cancel-in-progress: true
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2

View file

@ -10,19 +10,13 @@ env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
CI_GROUP_SUFFIX: >
${{
github.ref == 'refs/heads/main' && format('main-{0}', github.sha) ||
github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) ||
github.ref
}}
jobs:
# Build Android Tests [Matrix SDK]
build-android-test-matrix-sdk:
name: Matrix SDK - Build Android Tests
runs-on: ubuntu-latest
concurrency:
group: ${{ format('test-matrix-sdk-{0}', env.CI_GROUP_SUFFIX) }}
group: ${{ github.ref == 'refs/heads/main' && format('test-matrix-sdk-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('test-matrix-sdk-develop-{0}', github.sha) || format('test-matrix-sdk-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -42,7 +36,7 @@ jobs:
name: App - Build Android Tests
runs-on: ubuntu-latest
concurrency:
group: ${{ format('test-app-{0}', env.CI_GROUP_SUFFIX) }}
group: ${{ github.ref == 'refs/heads/main' && format('test-app-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('test-app-develop-{0}', github.sha) || format('test-app-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -62,7 +56,7 @@ jobs:
name: Matrix SDK - Running Integration Tests
runs-on: ubuntu-latest
concurrency:
group: ${{ format('integration-tests-{0}', env.CI_GROUP_SUFFIX) }}
group: ${{ github.ref == 'refs/heads/main' && format('integration-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}', github.sha) || format('integration-tests-{0}', github.ref) }}
cancel-in-progress: true
strategy:
fail-fast: false

View file

@ -5,14 +5,6 @@ on:
push:
branches: [ main, develop ]
env:
CI_GROUP_SUFFIX: >
${{
github.ref == 'refs/heads/main' && format('main-{0}', github.sha) ||
github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) ||
github.ref
}}
jobs:
check:
name: Project Check Suite
@ -27,7 +19,7 @@ jobs:
name: Kotlin Linter
runs-on: ubuntu-latest
concurrency:
group: ${{ format('klint-{0}', env.CI_GROUP_SUFFIX) }}
group: ${{ github.ref == 'refs/heads/main' && format('klint-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('klint-develop-{0}', github.sha) || format('klint-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
@ -99,7 +91,7 @@ jobs:
name: Android Linter
runs-on: ubuntu-latest
concurrency:
group: ${{ format('android-lint-{0}', env.CI_GROUP_SUFFIX) }}
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
@ -125,14 +117,14 @@ jobs:
apk-lint:
name: Lint APK (${{ matrix.target }})
runs-on: ubuntu-latest
concurrency:
group: ${{ format('apk-lint-{0}', env.CI_GROUP_SUFFIX) }}
cancel-in-progress: true
if: github.ref != 'refs/heads/main'
strategy:
fail-fast: false
matrix:
target: [ Gplay, Fdroid ]
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('apk-lint-develop-{0}', github.sha) || format('apk-lint-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2

View file

@ -10,18 +10,12 @@ env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
CI_GROUP_SUFFIX: >
${{
github.ref == 'refs/heads/main' && format('main-{0}', github.sha) ||
github.ref == 'refs/heads/develop' && format('develop-{0}', github.sha) ||
github.ref
}}
jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
concurrency:
group: ${{ format('unit-tests-{0}', env.CI_GROUP_SUFFIX) }}
group: ${{ github.ref == 'refs/heads/main' && format('unit-test-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-test-develop-{0}', github.sha) || format('unit-test-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2