From 1c9291455d84e2fdc18fb12c3e731bedf73e0266 Mon Sep 17 00:00:00 2001 From: tamirms Date: Thu, 7 Sep 2023 09:35:23 +0100 Subject: [PATCH 1/3] Fix caching of integration test runs --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 2229cfe8de..345ca21faf 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -122,7 +122,7 @@ jobs: run: go test -race -timeout 45m -v ./services/horizon/internal/integration/... - name: Save Horizon binary and integration tests source hash to cache - if: ${{ success() }} + if: ${{ success() && steps.horizon_binary_tests_hash.outputs.cache-hit != 'true' }} uses: actions/cache/save@v3 with: path: ./empty From 4f46cec5da8f52707d31d781b428d96ecef56321 Mon Sep 17 00:00:00 2001 From: tamirms Date: Thu, 7 Sep 2023 10:48:28 +0100 Subject: [PATCH 2/3] include prefix in hash --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 345ca21faf..acb6c65263 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -108,7 +108,7 @@ jobs: - name: Calculate the source hash id: calculate_source_hash run: | - combined_hash=$(echo "horizon-hash-${{ hashFiles('./horizon') }}-${{ hashFiles('./clients/horizonclient/**') }}-${{ hashFiles('./protocols/horizon/**') }}-${{ hashFiles('./txnbuild/**') }}-${{ hashFiles('./ingest/**') }}-${{ hashFiles('./xdr/**') }}-${{ hashFiles('./services/**') }}-${{ env.PROTOCOL_20_CORE_DOCKER_IMG }}-${{ env.PROTOCOL_19_CORE_DOCKER_IMG }}-${{ github.job }}" | sha256sum | cut -d ' ' -f 1) + combined_hash=$(echo "horizon-hash-${{ hashFiles('./horizon') }}-${{ hashFiles('./clients/horizonclient/**') }}-${{ hashFiles('./protocols/horizon/**') }}-${{ hashFiles('./txnbuild/**') }}-${{ hashFiles('./ingest/**') }}-${{ hashFiles('./xdr/**') }}-${{ hashFiles('./services/**') }}-${{ env.PROTOCOL_20_CORE_DOCKER_IMG }}-${{ env.PROTOCOL_19_CORE_DOCKER_IMG }}-${{ env.PREFIX }}" | sha256sum | cut -d ' ' -f 1) echo "COMBINED_SOURCE_HASH=$combined_hash" >> "$GITHUB_ENV" - name: Restore Horizon binary and integration tests source hash to cache From 0d01fd18cd4682e1efe49ac8b08a6b8abcb37db1 Mon Sep 17 00:00:00 2001 From: tamirms Date: Thu, 7 Sep 2023 16:20:03 +0100 Subject: [PATCH 3/3] set lookup-only --- .github/workflows/horizon.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index acb6c65263..16c60ccd45 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -116,6 +116,7 @@ jobs: uses: actions/cache/restore@v3 with: path: ./empty + lookup-only: true key: ${{ env.COMBINED_SOURCE_HASH }} - if: ${{ steps.horizon_binary_tests_hash.outputs.cache-hit != 'true' }}