From 32b19aab15dbd62ce49e100e48851089decd5d5f Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 4 Feb 2025 17:52:05 -0800 Subject: [PATCH] Update gradle caching (#13208) --- .github/workflows/build-common.yml | 12 +----------- .github/workflows/build.yml | 3 --- .github/workflows/codeql.yml | 16 +++++++++++----- .../pr-smoke-test-early-jdk8-images.yml | 2 -- .../pr-smoke-test-fake-backend-images.yml | 2 -- .github/workflows/reusable-test-indy.yml | 2 -- .github/workflows/reusable-test-latest-deps.yml | 2 -- 7 files changed, 12 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-common.yml b/.github/workflows/build-common.yml index 587a6cf2b9..705fd06e74 100644 --- a/.github/workflows/build-common.yml +++ b/.github/workflows/build-common.yml @@ -44,8 +44,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Spotless run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }} @@ -68,8 +66,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Generate license report run: ./gradlew generateLicenseReport ${{ inputs.no-build-cache && '--no-build-cache' || '' }} @@ -151,8 +147,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Build # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ @@ -253,8 +247,6 @@ jobs: with: # only push cache for one matrix option since github action cache space is limited cache-read-only: ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: List tests # "check" is needed to activate all tests for listing purposes @@ -379,12 +371,10 @@ jobs: with: # only push cache for one matrix option per OS since github action cache space is limited cache-read-only: ${{ inputs.cache-read-only || matrix.smoke-test-suite != 'tomcat' }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Build # running suite "none" compiles everything needed by smoke tests without executing any tests - run: ./gradlew :smoke-tests:test -PsmokeTestSuite=none --no-daemon ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} + run: ./gradlew :smoke-tests:test -PsmokeTestSuite=none ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} - name: Test run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}${{ inputs.no-build-cache && ' --no-build-cache' || '' }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb4ed9a5dc..d8b564c46e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,9 +77,6 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 - with: - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Build and publish artifact snapshots env: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 179597163e..bee46b2486 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -37,12 +37,21 @@ jobs: - name: Free disk space run: .github/scripts/gha-free-disk-space.sh - - name: Set up Java 17 + - name: Set up JDK for running Gradle uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: distribution: temurin java-version-file: .java-version + - name: Increase gradle daemon heap size + run: | + sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 + with: + cache-read-only: ${{ github.event_name == 'pull_request' }} + - name: Initialize CodeQL uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 with: @@ -51,12 +60,9 @@ jobs: # see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433 tools: latest - - name: Setup Gradle - uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 - - name: Build # skipping build cache is needed so that all modules will be analyzed - run: ./gradlew assemble -x javadoc --no-build-cache --no-daemon + run: ./gradlew assemble -x javadoc - name: Perform CodeQL analysis uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 diff --git a/.github/workflows/pr-smoke-test-early-jdk8-images.yml b/.github/workflows/pr-smoke-test-early-jdk8-images.yml index a28f96dfc4..9b420ad7e2 100644 --- a/.github/workflows/pr-smoke-test-early-jdk8-images.yml +++ b/.github/workflows/pr-smoke-test-early-jdk8-images.yml @@ -28,8 +28,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: true - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Build Docker image run: ./gradlew :smoke-tests:images:early-jdk8:imageBuild diff --git a/.github/workflows/pr-smoke-test-fake-backend-images.yml b/.github/workflows/pr-smoke-test-fake-backend-images.yml index a651efbbbb..bf5323d83f 100644 --- a/.github/workflows/pr-smoke-test-fake-backend-images.yml +++ b/.github/workflows/pr-smoke-test-fake-backend-images.yml @@ -28,8 +28,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: true - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: Build Docker image run: ./gradlew :smoke-tests:images:fake-backend:jibDockerBuild -Djib.httpTimeout=120000 -Djib.console=plain diff --git a/.github/workflows/reusable-test-indy.yml b/.github/workflows/reusable-test-indy.yml index 2c89cf3dc8..935967594b 100644 --- a/.github/workflows/reusable-test-indy.yml +++ b/.github/workflows/reusable-test-indy.yml @@ -64,8 +64,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: List tests run: > diff --git a/.github/workflows/reusable-test-latest-deps.yml b/.github/workflows/reusable-test-latest-deps.yml index 0450c76c0c..0aed1f36f6 100644 --- a/.github/workflows/reusable-test-latest-deps.yml +++ b/.github/workflows/reusable-test-latest-deps.yml @@ -61,8 +61,6 @@ jobs: uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 - name: List tests run: >