From d8d3f6407c86442c2eb69b0d09d931dd8f806b03 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 9 Mar 2022 21:12:34 -0400 Subject: [PATCH] build(cache): do not use GHA cache for images (#3794) GitHub's GHA cache gets invalidated at 10Gb, which is very easy to hit when we're building multiple times a day with several commits. Instead use the registry, which won't get invalidated until a change is identified in the build process. --- .github/workflows/cd.yml | 4 ++-- .github/workflows/test-full-sync.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- .github/workflows/zcash-lightwalletd.yml | 4 ++-- .github/workflows/zcash-params.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index cd411b55..a8424e82 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -110,8 +110,8 @@ jobs: CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} push: true - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }}:buildcache,mode=max deploy-nodes: name: Deploy Mainnet nodes diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index c595ddaf..79e9eec9 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -112,8 +112,8 @@ jobs: RUST_LOG=debug SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} push: true - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max # Test that Zebra can run a full mainnet sync after a PR is approved test-full-sync: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3caa79f..3287f655 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -113,8 +113,8 @@ jobs: RUST_LOG=debug SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} push: true - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max # Run all the zebra tests, including tests that are ignored by default test-all: diff --git a/.github/workflows/zcash-lightwalletd.yml b/.github/workflows/zcash-lightwalletd.yml index 16890872..c74ea986 100644 --- a/.github/workflows/zcash-lightwalletd.yml +++ b/.github/workflows/zcash-lightwalletd.yml @@ -104,5 +104,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: true - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max diff --git a/.github/workflows/zcash-params.yml b/.github/workflows/zcash-params.yml index 5d124137..b6cb84e5 100644 --- a/.github/workflows/zcash-params.yml +++ b/.github/workflows/zcash-params.yml @@ -100,5 +100,5 @@ jobs: ZEBRA_SKIP_IPV6_TESTS="1" SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} push: true - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max