ci: use simpler caching mechanisms (#2236)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -231,4 +231,3 @@ jobs:
|
||||
checks: write
|
||||
with:
|
||||
checkout_ref: ${{ needs.resolve_ref.outputs.commit_sha }}
|
||||
save_gradle_cache: true
|
||||
|
||||
@@ -27,7 +27,6 @@ jobs:
|
||||
checks: write
|
||||
with:
|
||||
checkout_ref: ${{ github.sha }}
|
||||
save_gradle_cache: true
|
||||
|
||||
semantic-version:
|
||||
name: Compute Release and Changelog
|
||||
|
||||
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user