23
23
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS : 4
24
24
ANTSPATH : /usr/share/miniconda/bin/
25
25
NIFREEZE_WERRORS : 1
26
+ TEST_DATA_REPO : https://gin.g-node.org/nipreps-data/tests-nifreeze
26
27
27
28
concurrency :
28
29
group : ${{ github.workflow }}-${{ github.ref }}
@@ -32,30 +33,37 @@ permissions:
32
33
contents : read
33
34
34
35
jobs :
35
- cache-data :
36
+ cache-test- data :
36
37
runs-on : ' ubuntu-latest'
38
+ outputs :
39
+ SHA : ${{ steps.test-head.outputs.SHA }}
37
40
steps :
41
+ - name : Check remote HEAD
42
+ id : test-head
43
+ run : git ls-remote $TEST_DATA_REPO | awk '/HEAD/{ print "SHA=" $1 }' >> $GITHUB_OUTPUT
44
+ - uses : actions/cache@v4
45
+ id : test-data
46
+ with :
47
+ path : /home/runner/nifreeze-tests/
48
+ key : data-v1-${{ steps.test-head.outputs.SHA }}
49
+ restore-keys : |
50
+ data-v1
51
+ data-v0
38
52
- name : Install the latest version of uv
39
53
uses : astral-sh/setup-uv@v5
54
+ if : steps.test-data.outputs.cache-hit != 'true'
40
55
- name : Install datalad
56
+ if : steps.test-data.outputs.cache-hit != 'true'
41
57
run : |
42
58
uvx datalad-installer --sudo ok git-annex
43
59
uv tool install --with=datalad-osf --with=datalad-next datalad
44
60
uv tool install --with=datalad-next datalad-osf
45
61
datalad wtf
46
- - uses : actions/cache@v4
47
- id : test-data
48
- with :
49
- path : /home/runner/nifreeze-tests/
50
- key : data-v1
51
- restore-keys : |
52
- data-v1
53
- data-v0
54
62
- name : Get test data with DataLad
55
63
if : steps.test-data.outputs.cache-hit != 'true'
56
64
run : |
57
65
if [[ ! -d "${TEST_DATA_HOME}" ]]; then
58
- datalad install -rg --source=https://gin.g-node.org/nipreps-data/tests-nifreeze.git ${TEST_DATA_HOME}
66
+ datalad install -rg --source=${TEST_DATA_REPO} ${TEST_DATA_HOME}
59
67
else
60
68
cd ${TEST_DATA_HOME}
61
69
datalad update --merge -r .
65
73
stable :
66
74
# Unit tests only on Linux/Python 3.12
67
75
runs-on : ' ubuntu-latest'
68
- needs : ['cache-data']
76
+ needs : ['cache-test- data']
69
77
steps :
70
78
- uses : actions/checkout@v4
71
79
with :
@@ -78,21 +86,10 @@ jobs:
78
86
- name : Install ANTs
79
87
run : |
80
88
conda install -c conda-forge ants=2.5
81
- - name : Install datalad
82
- run : |
83
- python -m pip install datalad-installer
84
- datalad-installer --sudo ok git-annex
85
- python -m pip install datalad datalad-osf
86
- datalad wtf
87
89
- uses : actions/cache/restore@v4
88
90
with :
89
91
path : /home/runner/nifreeze-tests/
90
- key : data-v1
91
- - name : Update test data
92
- run : |
93
- cd ${TEST_DATA_HOME}
94
- datalad update --merge -r .
95
- datalad get -r -J4 *
92
+ key : data-v1-${{ needs.cache-test-data.outputs.SHA }}
96
93
- name : Install TeX Live
97
94
run : |
98
95
sudo apt-get update
0 commit comments