From 400a47c39b67914dc6e308e37690c0531b77eede Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Fri, 11 Mar 2022 08:45:04 +0000 Subject: [PATCH] Only run one gradlew build for all tests, do not split by project --- .github/workflows/tests.yml | 39 +++++++++---------------------------- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 74f31f4888..3a493e436f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,11 +12,13 @@ env: -Porg.gradle.parallel=false jobs: - # Build Android Tests [Matrix SDK] - build-android-test-matrix-sdk: - name: Matrix SDK - Build Android Tests + # Build Android Tests + build-android-tests: + name: Build Android Tests runs-on: ubuntu-latest - # No concurrency required, runs every time on a schedule. + 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@v3 - uses: actions/setup-java@v2 @@ -31,31 +33,9 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Build Android Tests for matrix-sdk-android - run: ./gradlew clean matrix-sdk-android:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace + - name: Build Android Tests + run: ./gradlew clean assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace - # Build Android Tests [Matrix APP] - build-android-test-app: - name: App - Build Android Tests - runs-on: ubuntu-latest - # No concurrency required, runs every time on a schedule. - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: 11 - - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Build Android Tests for vector - run: ./gradlew clean vector:assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace - unit-tests: name: Run Unit Tests runs-on: ubuntu-latest @@ -91,8 +71,7 @@ jobs: runs-on: ubuntu-latest needs: - unit-tests - - build-android-test-matrix-sdk - - build-android-test-app + - build-android-tests if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' ) && failure() }} steps: - uses: michaelkaye/matrix-hookshot-action@v0.3.0