Skip to content

Commit 9dec1b4

Browse files
authored
Merge pull request #5804 from unisonweb/arya/careful-cross-job-cache
don't use `actions/cache` to share artifacts between jobs
2 parents 9f48a80 + 05417a7 commit 9dec1b4

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
7373
with:
7474
path: ${{env.ucm_local_bin}}
75-
key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs', '**/unison-cli-integration/integrationtests/IntegrationTests/*')}}
75+
key: ucm-${{ matrix.os }}-${{ hashFiles('**/ci.yaml', '**/stack.yaml', '**/package.yaml', '**/*.hs', '**/unison-cli-integration/integration-tests/IntegrationTests/*')}}
7676
# added the integration test dependencies here as if they were source, for simplicity
7777

7878
- name: restore stack caches
@@ -174,6 +174,13 @@ jobs:
174174
path: ${{ env.ucm }}
175175
if-no-files-found: error
176176

177+
- name: save built binaries
178+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
179+
with:
180+
path: ${{ env.ucm_local_bin }}
181+
name: local-bin-${{ matrix.os }}
182+
if-no-files-found: error
183+
177184
- name: save stack caches
178185
if: |
179186
!cancelled()
@@ -230,12 +237,15 @@ jobs:
230237
path: ${{env.transcript_test_results}}
231238
key: transcripts-results-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}}-${{ hashFiles('**/unison-src/**/*.md', '**/unison-src/**/*.u') }}
232239
- name: restore binaries
233-
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
240+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
234241
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
235242
with:
236243
path: ${{env.ucm_local_bin}}
237-
key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}}
238-
fail-on-cache-miss: true
244+
name: local-bin-${{matrix.os}}
245+
if-no-files-found: error
246+
- name: set built binaries permissions
247+
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
248+
run: chmod +x ${{env.ucm_local_bin}}/*
239249
# One of the transcripts fails if the user's git name hasn't been set.
240250
## (Which transcript? -AI)
241251
- name: set git user info
@@ -324,12 +334,15 @@ jobs:
324334
key: runtime-tests-codebase-${{env.runtime_tests_causalhash}}
325335
restore-keys: runtime-tests-codebase-
326336
- name: restore binaries
327-
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
328-
if: steps.cache-interpreter-test-results.outputs.cache-hit != 'true'
337+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
338+
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
329339
with:
330340
path: ${{env.ucm_local_bin}}
331-
key: ucm-${{ matrix.os }}-${{ hashFiles('**/stack.yaml', '**/package.yaml', '**/*.hs')}}
332-
fail-on-cache-miss: true
341+
name: local-bin-${{ matrix.os }}
342+
if-no-files-found: error
343+
- name: set binaries permissions
344+
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
345+
run: chmod +x ${{env.ucm_local_bin}}/*
333346
- name: interpreter tests
334347
# this one should be re-run if the ucm binaries have changed or unison-src/ has changed
335348
if: steps.cache-interpreter-test-results.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)