From e52666a2f58aa834d02f29bc45071f5f26d43132 Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Sat, 12 Jul 2025 08:44:18 +0300 Subject: [PATCH 1/3] don't use `actions/cache` to share artifacts between jobs thanks @chrispenner for the suggestion closes #5800 --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b31db86bc..593614c6dc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4 with: path: ${{env.ucm_local_bin}} - key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs', '**/unison-cli-integration/integrationtests/IntegrationTests/*')}} + key: ucm-${{ matrix.os }}-${{ hashFiles('**/ci.yaml', '**/stack.yaml', '**/package.yaml', '**/*.hs', '**/unison-cli-integration/integrationtests/IntegrationTests/*')}} # added the integration test dependencies here as if they were source, for simplicity - name: restore stack caches @@ -174,6 +174,13 @@ jobs: path: ${{ env.ucm }} if-no-files-found: error + - name: save built binaries + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + with: + path: ${{ env.ucm_local_bin }} + name: local-bin-${{ matrix.os }} + if-no-files-found: error + - name: save stack caches if: | !cancelled() @@ -230,12 +237,15 @@ jobs: path: ${{env.transcript_test_results}} key: transcripts-results-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}}-${{ hashFiles('**/unison-src/**/*.md', '**/unison-src/**/*.u') }} - name: restore binaries - uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4 + uses: actions/download-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 if: steps.cache-transcript-test-results.outputs.cache-hit != 'true' with: path: ${{env.ucm_local_bin}} - key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}} - fail-on-cache-miss: true + name: local-bin-${{matrix.os}} + if-no-files-found: error + - name: set built binaries permissions + if: steps.cache-transcript-test-results.outputs.cache-hit != 'true' + run: chmod +x ${{env.ucm_local_bin}}/* # One of the transcripts fails if the user's git name hasn't been set. ## (Which transcript? -AI) - name: set git user info @@ -324,12 +334,15 @@ jobs: key: runtime-tests-codebase-${{env.runtime_tests_causalhash}} restore-keys: runtime-tests-codebase- - name: restore binaries - uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4 - if: steps.cache-interpreter-test-results.outputs.cache-hit != 'true' + uses: actions/download-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + if: steps.cache-transcript-test-results.outputs.cache-hit != 'true' with: path: ${{env.ucm_local_bin}} - key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}} - fail-on-cache-miss: true + name: local-bin-${{ matrix.os }} + if-no-files-found: error + - name: set binaries permissions + if: steps.cache-transcript-test-results.outputs.cache-hit != 'true' + run: chmod +x ${{env.ucm_local_bin}}/* - name: interpreter tests # this one should be re-run if the ucm binaries have changed or unison-src/ has changed if: steps.cache-interpreter-test-results.outputs.cache-hit != 'true' From 5248024eb7d70ee1b6002ec1957d05be873687ff Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Sat, 12 Jul 2025 10:31:15 +0300 Subject: [PATCH 2/3] copy-paste error --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 593614c6dc..1194b4fc05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -237,7 +237,7 @@ jobs: path: ${{env.transcript_test_results}} key: transcripts-results-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}}-${{ hashFiles('**/unison-src/**/*.md', '**/unison-src/**/*.u') }} - name: restore binaries - uses: actions/download-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4 if: steps.cache-transcript-test-results.outputs.cache-hit != 'true' with: path: ${{env.ucm_local_bin}} @@ -334,7 +334,7 @@ jobs: key: runtime-tests-codebase-${{env.runtime_tests_causalhash}} restore-keys: runtime-tests-codebase- - name: restore binaries - uses: actions/download-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4 if: steps.cache-transcript-test-results.outputs.cache-hit != 'true' with: path: ${{env.ucm_local_bin}} From 05417a77fb5e830e73830eed0a633bc45f5ea224 Mon Sep 17 00:00:00 2001 From: Arya Irani <538571+aryairani@users.noreply.github.com> Date: Sat, 12 Jul 2025 10:33:38 +0300 Subject: [PATCH 3/3] Update .github/workflows/ci.yaml Co-authored-by: Greg Pfeil --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1194b4fc05..b7f5b42eb5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4 with: path: ${{env.ucm_local_bin}} - key: ucm-${{ matrix.os }}-${{ hashFiles('**/ci.yaml', '**/stack.yaml', '**/package.yaml', '**/*.hs', '**/unison-cli-integration/integrationtests/IntegrationTests/*')}} + key: ucm-${{ matrix.os }}-${{ hashFiles('**/ci.yaml', '**/stack.yaml', '**/package.yaml', '**/*.hs', '**/unison-cli-integration/integration-tests/IntegrationTests/*')}} # added the integration test dependencies here as if they were source, for simplicity - name: restore stack caches