From 7e0a284669aa6e22e6c1518ee2ac63a7bd229537 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 7 Mar 2023 13:32:32 +0000 Subject: [PATCH] Use the gradle plugin (same usage as in element-android) to standardise caching. This may or may not speed up build times. --- .github/workflows/build.yml | 4 ++++ .github/workflows/quality.yml | 8 ++++++++ .github/workflows/tests.yml | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d926e4fb9..f8fa3b4dff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,10 @@ jobs: # Ensure we are building the branch and not the branch after being merged on develop # https://github.com/actions/checkout/issues/881 ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} + - name: Configure gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Assemble debug APK run: ./gradlew assembleDebug $CI_GRADLE_ARG_PROPERTIES - name: Upload debug APKs diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 09b66d267b..8f6fe6112c 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -21,6 +21,10 @@ jobs: cancel-in-progress: true steps: - uses: actions/checkout@v3 + - name: Configure gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Run code quality check suite run: ./gradlew runQualityChecks $CI_GRADLE_ARG_PROPERTIES - name: Upload reports @@ -56,6 +60,10 @@ jobs: cancel-in-progress: true steps: - uses: actions/checkout@v3 + - name: Configure gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Dependency analysis run: ./gradlew dependencyCheckAnalyze $CI_GRADLE_ARG_PROPERTIES - name: Upload dependency analysis diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16142e84c8..a4fce4b8e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,6 +25,10 @@ jobs: uses: actions/checkout@v3 with: lfs: 'true' + - name: Configure gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: ⚙️ Run unit & screenshot tests, generate kover report run: ./gradlew koverMergedReport $CI_GRADLE_ARG_PROPERTIES -Pci-build=true