From 72c000930a24032aa4d595c988d22860e3079d95 Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Fri, 20 Oct 2023 13:30:45 +0200 Subject: [PATCH 1/3] Make CI always write to cache even in non-develop branch --- .github/ci-gradle.properties | 1 + .github/workflows/integration-test.yml | 2 +- .github/workflows/pr.yml | 8 ++++---- .github/workflows/staging.yml | 2 +- .github/workflows/unused-resources.yml | 2 +- .github/workflows/upload-to-play-store.yml | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties index 311b17bc19..53119958a4 100644 --- a/.github/ci-gradle.properties +++ b/.github/ci-gradle.properties @@ -3,6 +3,7 @@ org.gradle.parallel=true org.gradle.jvmargs=-Xmx5120m -XX:+UseParallelGC org.gradle.workers.max=2 org.gradle.configuration-cache=true +org.gradle.caching=true kotlin.incremental=false kotlin.compiler.execution.strategy=in-process \ No newline at end of file diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index b80e30432b..178313fbda 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -26,7 +26,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - name: Prebuild run: ./scripts/ci-prebuild.sh diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 760f9a7626..e3015ff920 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,7 +22,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - name: Prebuild run: ./scripts/ci-prebuild.sh @@ -56,7 +56,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - name: Prebuild run: ./scripts/ci-prebuild.sh @@ -89,7 +89,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - name: Prebuild run: ./scripts/ci-prebuild.sh @@ -126,7 +126,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - run: echo VERSION_CODE=$(expr 4700 + ${{ github.run_number }} + ${{ github.run_attempt }} - 1) >> $GITHUB_ENV - uses: chkfung/android-version-actions@v1.2 diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 9054f3d5b9..6d1439e464 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -25,7 +25,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - run: echo VERSION_CODE=$(expr 4700 + ${{ github.run_number }} + ${{ github.run_attempt }} - 1) >> $GITHUB_ENV - uses: chkfung/android-version-actions@v1.2 diff --git a/.github/workflows/unused-resources.yml b/.github/workflows/unused-resources.yml index 412739ad9e..446a7aeaeb 100644 --- a/.github/workflows/unused-resources.yml +++ b/.github/workflows/unused-resources.yml @@ -25,7 +25,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - name: Prebuild diff --git a/.github/workflows/upload-to-play-store.yml b/.github/workflows/upload-to-play-store.yml index 635d399cd2..ece16f38de 100644 --- a/.github/workflows/upload-to-play-store.yml +++ b/.github/workflows/upload-to-play-store.yml @@ -26,7 +26,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: # Only write to the cache for builds on the 'develop' branch - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + cache-read-only: false gradle-home-cache-cleanup: true - run: echo VERSION_CODE=$(date +%s) >> $GITHUB_ENV - uses: chkfung/android-version-actions@v1.2 From 42ae82db92690c046859e8bd209de6b2fdad38fa Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Fri, 20 Oct 2023 13:30:58 +0200 Subject: [PATCH 2/3] Use our custom ubuntu-latest-32vcpu runner to test --- .github/workflows/pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e3015ff920..5fecd82399 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,7 +3,7 @@ name: PR on: pull_request jobs: unit_test: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-32vcpu steps: - uses: actions/checkout@v4 - name: Copy CI gradle.properties @@ -37,7 +37,7 @@ jobs: paths: "app/build/test-results/testDebugUnitTest/**/TEST-*.xml" if: always() lint: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-32vcpu steps: - uses: actions/checkout@v4 - name: Copy CI gradle.properties @@ -70,7 +70,7 @@ jobs: report-path: app/build/reports/lint-results-debug.xml continue-on-error: true ktlint: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-32vcpu steps: - uses: actions/checkout@v4 - name: Copy CI gradle.properties @@ -106,7 +106,7 @@ jobs: with: report-path: build/reports/ktlint/*.xml build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-32vcpu steps: - name: Checkout uses: actions/checkout@v4 From a433266d256ef95e1ec42b51d2529a4f0a8bf729 Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Fri, 20 Oct 2023 13:39:45 +0200 Subject: [PATCH 3/3] Change to ubuntu-latest-64vcpu runner --- .github/workflows/pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5fecd82399..4fc59f58ec 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,7 +3,7 @@ name: PR on: pull_request jobs: unit_test: - runs-on: ubuntu-latest-32vcpu + runs-on: ubuntu-latest-64vcpu steps: - uses: actions/checkout@v4 - name: Copy CI gradle.properties @@ -37,7 +37,7 @@ jobs: paths: "app/build/test-results/testDebugUnitTest/**/TEST-*.xml" if: always() lint: - runs-on: ubuntu-latest-32vcpu + runs-on: ubuntu-latest-64vcpu steps: - uses: actions/checkout@v4 - name: Copy CI gradle.properties @@ -70,7 +70,7 @@ jobs: report-path: app/build/reports/lint-results-debug.xml continue-on-error: true ktlint: - runs-on: ubuntu-latest-32vcpu + runs-on: ubuntu-latest-64vcpu steps: - uses: actions/checkout@v4 - name: Copy CI gradle.properties @@ -106,7 +106,7 @@ jobs: with: report-path: build/reports/ktlint/*.xml build: - runs-on: ubuntu-latest-32vcpu + runs-on: ubuntu-latest-64vcpu steps: - name: Checkout uses: actions/checkout@v4