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,9 +33,58 @@ permissions:
32
33
contents : read
33
34
34
35
jobs :
36
+ cache-test-data :
37
+ runs-on : ' ubuntu-latest'
38
+ outputs :
39
+ SHA : ${{ steps.test-head.outputs.SHA }}
40
+ steps :
41
+ - name : Check remote HEAD
42
+ id : test-head
43
+ run : |
44
+ SHA=$( git ls-remote $TEST_DATA_REPO HEAD | cut -f 1 )
45
+ echo SHA=$SHA >> $GITHUB_OUTPUT
46
+ echo SHA7=${SHA:0:7} >> $GITHUB_OUTPUT
47
+ - name : Check for data-v1-${{ steps.test-head.outputs.SHA }}
48
+ uses : actions/cache@v4
49
+ id : test-data
50
+ with :
51
+ path : /home/runner/nifreeze-tests/
52
+ key : data-v1-${{ steps.test-head.outputs.SHA }}
53
+ lookup-only : true
54
+ - name : Create data-v1-${{ steps.test-head.outputs.SHA }}
55
+ uses : actions/cache@v4
56
+ if : steps.test-data.outputs.cache-hit != 'true'
57
+ with :
58
+ path : /home/runner/nifreeze-tests/
59
+ key : data-v1-${{ steps.test-head.outputs.SHA }}
60
+ restore-keys : |
61
+ data-v1
62
+ data-v0
63
+ - name : Install the latest version of uv
64
+ uses : astral-sh/setup-uv@v5
65
+ if : steps.test-data.outputs.cache-hit != 'true'
66
+ - name : Install datalad
67
+ if : steps.test-data.outputs.cache-hit != 'true'
68
+ run : |
69
+ uvx datalad-installer --sudo ok git-annex
70
+ uv tool install --with=datalad-osf --with=datalad-next datalad
71
+ uv tool install --with=datalad-next datalad-osf
72
+ datalad wtf
73
+ - name : Checkout commit ${{ steps.test-head.outputs.SHA7 }}
74
+ if : steps.test-data.outputs.cache-hit != 'true'
75
+ run : |
76
+ if [[ ! -d "${TEST_DATA_HOME}" ]]; then
77
+ datalad install -rg --source=${TEST_DATA_REPO} ${TEST_DATA_HOME}
78
+ else
79
+ cd ${TEST_DATA_HOME}
80
+ datalad update --merge -r .
81
+ datalad get -r -J4 *
82
+ fi
83
+
35
84
stable :
36
85
# Unit tests only on Linux/Python 3.12
37
86
runs-on : ' ubuntu-latest'
87
+ needs : ['cache-test-data']
38
88
steps :
39
89
- uses : actions/checkout@v4
40
90
with :
@@ -44,40 +94,30 @@ jobs:
44
94
uses : actions/setup-python@v5
45
95
with :
46
96
python-version : ' 3.12'
97
+ - name : Install the latest version of uv
98
+ uses : astral-sh/setup-uv@v5
47
99
- name : Install ANTs
48
100
run : |
49
- conda install -c conda-forge ants=2.5
50
- - name : Install datalad
101
+ # Override libiconv pre-installed from anaconda channel
102
+ # See https://github.com/conda-forge/libitk-feedstock/issues/98
103
+ # Since we're not creating a new environment, we must be explicit
104
+ conda install -c conda-forge ants=2.5 libiconv
105
+ - name : Verify antsRegistration path
51
106
run : |
52
- python -m pip install datalad-installer
53
- datalad-installer --sudo ok git-annex
54
- python -m pip install datalad datalad-osf
55
- datalad wtf
107
+ export PATH=$ANTSPATH:$PATH
108
+ which antsRegistration
109
+ antsRegistration --version
56
110
- uses : actions/cache/restore@v4
57
111
with :
58
112
path : /home/runner/nifreeze-tests/
59
- key : data-v0
60
- - name : Get test data with DataLad
61
- run : |
62
- if [[ ! -d "${TEST_DATA_HOME}" ]]; then
63
- datalad install -rg --source=https://gin.g-node.org/nipreps-data/tests-nifreeze.git ${TEST_DATA_HOME}
64
- else
65
- cd ${TEST_DATA_HOME}
66
- datalad update --merge -r .
67
- datalad get -r -J4 *
68
- fi
69
- - uses : actions/cache/save@v4
70
- with :
71
- path : /home/runner/nifreeze-tests/
72
- key : data-v0
113
+ key : data-v1-${{ needs.cache-test-data.outputs.SHA }}
73
114
- name : Install TeX Live
74
115
run : |
75
116
sudo apt-get update
76
117
sudo apt install texlive texlive-latex-extra texlive-fonts-recommended cm-super dvipng
77
118
- name : Install tox
78
119
run : |
79
- python -m pip install --upgrade pip
80
- python -m pip install tox tox-gh-actions
120
+ uv tool install --with=tox-uv --with=tox-gh-actions tox
81
121
- name : Show tox config
82
122
run : tox c
83
123
- name : Run tox
0 commit comments