From 0db0100ae45dcd94a6bd940239e9c21d77dc2447 Mon Sep 17 00:00:00 2001 From: James Ward Date: Wed, 5 Aug 2026 15:46:39 -0400 Subject: [PATCH] ci: use simpler caching mechanisms (#2236) --- .github/actions/export-openapi/action.yml | 6 +++++ .github/workflows/ci-validate.yml | 1 - .github/workflows/preview-image.yml | 24 ------------------ .github/workflows/publish-nightly.yml | 1 - .github/workflows/release-main.yml | 1 - .github/workflows/test-suite.yml | 31 +++++------------------ 6 files changed, 12 insertions(+), 52 deletions(-) diff --git a/.github/actions/export-openapi/action.yml b/.github/actions/export-openapi/action.yml index 4f310d458..5361e2a97 100644 --- a/.github/actions/export-openapi/action.yml +++ b/.github/actions/export-openapi/action.yml @@ -28,6 +28,12 @@ runs: with: java-version: '25' distribution: 'temurin' + cache: gradle + cache-dependency-path: | + **/*.gradle* + **/gradle.lockfile + **/settings.gradle* + **/gradle/wrapper/gradle-wrapper.properties - name: Export OpenAPI JSON shell: bash diff --git a/.github/workflows/ci-validate.yml b/.github/workflows/ci-validate.yml index 02639c5fc..01bdd6ca0 100644 --- a/.github/workflows/ci-validate.yml +++ b/.github/workflows/ci-validate.yml @@ -67,7 +67,6 @@ jobs: with: checkout_ref: ${{ github.sha }} publish_test_results: false - save_gradle_cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} packaging-smoke-test: name: Packaging Smoke Test diff --git a/.github/workflows/preview-image.yml b/.github/workflows/preview-image.yml index f33e9e980..ae662a5be 100644 --- a/.github/workflows/preview-image.yml +++ b/.github/workflows/preview-image.yml @@ -12,11 +12,6 @@ on: required: false default: '' type: string - refresh_shared_cache: - description: 'Rebuild from scratch and refresh the shared image cache' - required: false - default: false - type: boolean jobs: build-and-push: @@ -67,7 +62,6 @@ jobs: password: ${{ github.token }} - name: Build and push Preview image - if: ${{ !inputs.refresh_shared_cache }} uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 with: context: . @@ -82,21 +76,3 @@ jobs: cache-from: | type=gha,scope=image-shared type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache - - - name: Build and push Preview image with cache refresh - if: ${{ inputs.refresh_shared_cache }} - uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 - with: - context: . - file: Dockerfile - platforms: linux/amd64 - push: true - no-cache: true - tags: | - ghcr.io/grimmory-tools/grimmory:${{ env.preview_tag }} - build-args: | - APP_VERSION=${{ env.preview_tag }} - APP_REVISION=${{ env.commit_sha }} - cache-to: | - type=gha,scope=image-shared,mode=max - type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache,mode=max diff --git a/.github/workflows/publish-nightly.yml b/.github/workflows/publish-nightly.yml index 9369bb6b8..1a7c5b33b 100644 --- a/.github/workflows/publish-nightly.yml +++ b/.github/workflows/publish-nightly.yml @@ -231,4 +231,3 @@ jobs: checks: write with: checkout_ref: ${{ needs.resolve_ref.outputs.commit_sha }} - save_gradle_cache: true diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml index 10bfb6b19..cd6217e20 100644 --- a/.github/workflows/release-main.yml +++ b/.github/workflows/release-main.yml @@ -27,7 +27,6 @@ jobs: checks: write with: checkout_ref: ${{ github.sha }} - save_gradle_cache: true semantic-version: name: Compute Release and Changelog diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9bf662cda..7297c3f86 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -12,11 +12,6 @@ on: required: false type: boolean default: true - save_gradle_cache: - description: 'Whether this run should persist the shared Gradle cache' - required: false - type: boolean - default: false jobs: backend-tests: @@ -44,17 +39,12 @@ jobs: with: java-version: '25' distribution: 'temurin' - - - name: Restore Gradle Cache - id: restore_gradle_cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: gradle-${{ runner.os }}-${{ hashFiles('backend/**/*.gradle*', 'backend/gradle.lockfile', 'backend/settings.gradle*', 'backend/gradle.properties', 'backend/gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: | - gradle-${{ runner.os }}- + cache: gradle + cache-dependency-path: | + **/*.gradle* + **/gradle.lockfile + **/settings.gradle* + **/gradle/wrapper/gradle-wrapper.properties # Needed for NightCompress - name: Install libarchive @@ -90,15 +80,6 @@ jobs: backend/build/test-results/ retention-days: 30 - - name: Save Gradle Cache - if: ${{ always() && inputs.save_gradle_cache }} - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ steps.restore_gradle_cache.outputs.cache-primary-key }} - - name: Validate Backend Test Results if: steps.backend_tests.outcome == 'failure' run: |