From 4e22d10c22f83416b6e0de0592b3928c50a0f652 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 28 Aug 2025 16:35:31 +1000 Subject: [PATCH 1/3] add image caching for horizon and friendbot --- .github/workflows/build.yml | 52 +++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 293b563aa..a044be642 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,10 +140,34 @@ jobs: name: image-stellar-core-${{ inputs.tag }}-${{ inputs.arch }} path: /tmp/image - build-stellar-horizon: + load-stellar-horizon-from-cache: needs: [shas] runs-on: ubuntu-latest + outputs: + cache-hit: ${{ steps.cache.outputs.cache-hit }} steps: + - id: cache + uses: actions/cache@v3 + with: + path: /tmp/image + key: image-stellar-horizon-${{ inputs.arch }}-${{ needs.shas.outputs.rpc }} + - name: Upload Stellar-Horizon Image + if: steps.cache.outputs.cache-hit == 'true' + uses: actions/upload-artifact@v4 + with: + name: image-stellar-horizon-${{ inputs.tag }}-${{ inputs.arch }} + path: /tmp/image + + build-stellar-horizon: + needs: [shas, load-stellar-horizon-from-cache] + if: ${{ needs.load-stellar-horizon-from-cache.outputs.cache-hit != 'true' }} + runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-jammy-4-cores-arm64' || 'ubuntu-latest' }} + steps: + - id: cache + uses: actions/cache@v3 + with: + path: /tmp/image + key: image-stellar-horizon-${{ inputs.arch }}-${{ needs.shas.outputs.rpc }} - name: Checkout Quickstart for Horizon docker file uses: actions/checkout@v3 with: @@ -166,10 +190,34 @@ jobs: name: image-stellar-horizon-${{ inputs.tag }}-${{ inputs.arch }} path: /tmp/image - build-stellar-friendbot: + load-stellar-friendbot-from-cache: needs: [shas] runs-on: ubuntu-latest + outputs: + cache-hit: ${{ steps.cache.outputs.cache-hit }} steps: + - id: cache + uses: actions/cache@v3 + with: + path: /tmp/image + key: image-stellar-friendbot-${{ inputs.arch }}-${{ needs.shas.outputs.rpc }} + - name: Upload Stellar-Friendbot Image + if: steps.cache.outputs.cache-hit == 'true' + uses: actions/upload-artifact@v4 + with: + name: image-stellar-friendbot-${{ inputs.tag }}-${{ inputs.arch }} + path: /tmp/image + + build-stellar-friendbot: + needs: [shas, load-stellar-friendbot-from-cache] + if: ${{ needs.load-stellar-friendbot-from-cache.outputs.cache-hit != 'true' }} + runs-on: ubuntu-latest + steps: + - id: cache + uses: actions/cache@v3 + with: + path: /tmp/image + key: image-stellar-friendbot-${{ inputs.arch }}-${{ needs.shas.outputs.rpc }} - if: inputs.arch == 'arm64' uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 with: From c79ad3251162c53823575a759d3f54fa8fd36b3a Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 29 Aug 2025 09:58:49 +1000 Subject: [PATCH 2/3] invalidate cache --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79ecc0c2c..30fbc3827 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ env: # Cache ID is a value inserted into cache keys. Whenever changing the build # in a way that needs to use entirely new fresh builds, increment the number # by one so that all the keys become new. - CACHE_ID: 1 + CACHE_ID: 2 jobs: From 7255346293d7bcbc18e670d2f8d3ab83a2a53a62 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:00:48 +1000 Subject: [PATCH 3/3] undo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30fbc3827..79ecc0c2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ env: # Cache ID is a value inserted into cache keys. Whenever changing the build # in a way that needs to use entirely new fresh builds, increment the number # by one so that all the keys become new. - CACHE_ID: 2 + CACHE_ID: 1 jobs: