Skip to content

Commit 23d7393

Browse files
committed
Pass hash across jobs, restore only in tests
1 parent e8fe426 commit 23d7393

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/travis.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
runs-on: ubuntu-latest
2424
env:
2525
TEST_DATA_HOME: /home/runner/testdata/nitransforms-tests
26+
outputs:
27+
SHA: ${{ steps.test-head.outputs.SHA }}
2628
steps:
2729
- name: Git settings (pacify DataLad)
2830
run: |
@@ -46,16 +48,17 @@ jobs:
4648
$CONDA/bin/conda install -c conda-forge git-annex
4749
python -m pip install datalad datalad-next datalad-osf
4850
- name: Check remote HEAD
51+
id: test-head
4952
run: |
5053
git ls-remote https://gin.g-node.org/oesteban/nitransforms-tests \
51-
| awk '/HEAD/{ print "HEAD=" $1 }' >> $GITHUB_ENV
54+
| awk '/HEAD/{ print "SHA=" $1 }' >> $GITHUB_OUTPUT
5255
5356
- uses: actions/cache@v3
5457
with:
5558
path: ${{ env.TEST_DATA_HOME }}
56-
key: data-cache-v2-${{ env.HEAD }}
59+
key: data-cache-v2-${{ steps.test-head.outputs.SHA }}
5760
restore-keys: |
58-
data-cache-v2-${{ env.HEAD }}
61+
data-cache-v2-${{ steps.test-head.outputs.SHA }}
5962
data-cache-v2
6063
6164
- name: Install test data
@@ -82,12 +85,10 @@ jobs:
8285
uses: actions/setup-python@v4
8386
with:
8487
python-version: ${{ matrix.python-version }}
85-
- uses: actions/cache@v3
88+
- uses: actions/cache/restore@v3
8689
with:
8790
path: ${{ env.TEST_DATA_HOME }}
88-
key: data-cache-v2
89-
restore-keys: |
90-
data-cache-v2
91+
key: data-cache-v2-${{ needs.cache-test-data.outputs.SHA }}
9192

9293
- uses: actions/checkout@v3
9394
- name: Install minimal dependencies

0 commit comments

Comments
 (0)