From 30d4aa2e731f3022c68d88521f2e52adf65b7b34 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Tue, 9 Apr 2024 10:07:18 +0200 Subject: [PATCH] [CI] Fix tests --- .github/workflows/test-dev.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-dev.yml b/.github/workflows/test-dev.yml index 03814e34..027d01df 100644 --- a/.github/workflows/test-dev.yml +++ b/.github/workflows/test-dev.yml @@ -8,6 +8,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + is_main_branch: ${{ github.ref == 'refs/heads/dev-ose' }} + jobs: test: name: Tests without emulator @@ -21,9 +24,10 @@ jobs: - uses: gradle/actions/setup-gradle@v3 with: cache-encryption-key: ${{ secrets.gradle_encryption_key }} + cache-write-only: ${{ env.is_main_branch }} # otherwise build cache will grow larger and larger - name: Create app/build and gradle configuration cache - if: ${{ github.ref == 'refs/heads/dev-ose' }} + if: ${{ env.is_main_branch }} uses: actions/cache@v4 with: key: app_build-tests-without-emulator-${{ github.run_id }} @@ -31,7 +35,7 @@ jobs: .gradle/configuration-cache app/build - name: Use app/build and gradle configuration cache - if: ${{ github.ref != 'refs/heads/dev-ose' }} + if: ${{ env.is_main_branch }} uses: actions/cache/restore@v4 with: key: app_build-tests-without-emulator @@ -55,9 +59,10 @@ jobs: - uses: gradle/actions/setup-gradle@v3 with: cache-encryption-key: ${{ secrets.gradle_encryption_key }} + cache-write-only: ${{ env.is_main_branch }} # otherwise build cache will grow larger and larger - name: Create app/build and gradle configuration cache - if: ${{ github.ref == 'refs/heads/dev-ose' }} + if: ${{ env.is_main_branch }} uses: actions/cache@v4 with: key: app_build-tests-without-emulator-${{ github.run_id }} @@ -65,7 +70,7 @@ jobs: .gradle/configuration-cache app/build - name: Use app/build and gradle configuration cache - if: ${{ github.ref != 'refs/heads/dev-ose' }} + if: ${{ env.is_main_branch }} uses: actions/cache/restore@v4 with: key: app_build-tests-without-emulator