ci: use simpler caching mechanisms (#2236)
This commit is contained in:
@@ -28,6 +28,12 @@ runs:
|
|||||||
with:
|
with:
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
cache-dependency-path: |
|
||||||
|
**/*.gradle*
|
||||||
|
**/gradle.lockfile
|
||||||
|
**/settings.gradle*
|
||||||
|
**/gradle/wrapper/gradle-wrapper.properties
|
||||||
|
|
||||||
- name: Export OpenAPI JSON
|
- name: Export OpenAPI JSON
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
checkout_ref: ${{ github.sha }}
|
checkout_ref: ${{ github.sha }}
|
||||||
publish_test_results: false
|
publish_test_results: false
|
||||||
save_gradle_cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
|
|
||||||
|
|
||||||
packaging-smoke-test:
|
packaging-smoke-test:
|
||||||
name: Packaging Smoke Test
|
name: Packaging Smoke Test
|
||||||
|
|||||||
@@ -12,11 +12,6 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
refresh_shared_cache:
|
|
||||||
description: 'Rebuild from scratch and refresh the shared image cache'
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@@ -67,7 +62,6 @@ jobs:
|
|||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
- name: Build and push Preview image
|
- name: Build and push Preview image
|
||||||
if: ${{ !inputs.refresh_shared_cache }}
|
|
||||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -82,21 +76,3 @@ jobs:
|
|||||||
cache-from: |
|
cache-from: |
|
||||||
type=gha,scope=image-shared
|
type=gha,scope=image-shared
|
||||||
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache
|
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
|
checks: write
|
||||||
with:
|
with:
|
||||||
checkout_ref: ${{ needs.resolve_ref.outputs.commit_sha }}
|
checkout_ref: ${{ needs.resolve_ref.outputs.commit_sha }}
|
||||||
save_gradle_cache: true
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ jobs:
|
|||||||
checks: write
|
checks: write
|
||||||
with:
|
with:
|
||||||
checkout_ref: ${{ github.sha }}
|
checkout_ref: ${{ github.sha }}
|
||||||
save_gradle_cache: true
|
|
||||||
|
|
||||||
semantic-version:
|
semantic-version:
|
||||||
name: Compute Release and Changelog
|
name: Compute Release and Changelog
|
||||||
|
|||||||
@@ -12,11 +12,6 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
save_gradle_cache:
|
|
||||||
description: 'Whether this run should persist the shared Gradle cache'
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
backend-tests:
|
backend-tests:
|
||||||
@@ -44,17 +39,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
- name: Restore Gradle Cache
|
cache-dependency-path: |
|
||||||
id: restore_gradle_cache
|
**/*.gradle*
|
||||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
**/gradle.lockfile
|
||||||
with:
|
**/settings.gradle*
|
||||||
path: |
|
**/gradle/wrapper/gradle-wrapper.properties
|
||||||
~/.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 }}-
|
|
||||||
|
|
||||||
# Needed for NightCompress
|
# Needed for NightCompress
|
||||||
- name: Install libarchive
|
- name: Install libarchive
|
||||||
@@ -90,15 +80,6 @@ jobs:
|
|||||||
backend/build/test-results/
|
backend/build/test-results/
|
||||||
retention-days: 30
|
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
|
- name: Validate Backend Test Results
|
||||||
if: steps.backend_tests.outcome == 'failure'
|
if: steps.backend_tests.outcome == 'failure'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user