@@ -9,31 +9,46 @@ name: CI/CD
99on :
1010 push :
1111 branches : [ main, develop ]
12- tags : [ '*' ]
1312 pull_request :
1413 branches : [ main, develop ]
14+ release :
15+ types : [published]
1516 repository_dispatch :
16- types : [create-release]
17+ types : [create-post-release]
18+
19+ permissions :
20+ contents : read
21+ pages : write
22+ id-token : write
1723
1824jobs :
1925
2026 nipype-conv :
2127 runs-on : ubuntu-latest
2228 steps :
29+
2330 - name : Checkout
24- uses : actions/checkout@v3
25- - name : Revert version to most recent tag on upstream update
31+ uses : actions/checkout@v4
32+
33+ - name : Revert version to most recent version tag on upstream update
2634 if : github.event_name == 'repository_dispatch'
27- run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
28- - name : Set up Python ${{ matrix.python-version }}
29- uses : actions/setup-python@v4
35+ run : git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')
36+
37+ - name : Set up Python
38+ uses : actions/setup-python@v5
39+ with :
40+ python-version : ' 3.11'
41+
3042 - name : Install build dependencies
3143 run : python -m pip install --upgrade pip
44+
3245 - name : Install requirements
33- run : python -m pip install ./related-packages/fileformats -r ./nipype-auto-conv/requirements.txt
46+ run : python -m pip install -r ./nipype-auto-conv/requirements.txt ./related-packages/fileformats
47+
3448 - name : Run automatic Nipype > Pydra conversion
3549 run : ./nipype-auto-conv/generate
36- - uses : actions/upload-artifact@v3
50+
51+ - uses : actions/upload-artifact@v4
3752 with :
3853 name : converted-nipype
3954 path : pydra/tasks/afni/auto
@@ -43,43 +58,50 @@ jobs:
4358 runs-on : ubuntu-latest
4459 strategy :
4560 matrix :
46- python-version : ['3.8', '3.11 '] # Check oldest and newest versions
61+ python-version : ['3.8', '3.12 '] # Check oldest and newest versions
4762 pip-flags : ['', '--editable']
4863 pydra :
4964 - ' pydra'
5065 - ' --editable git+https://github.com/nipype/pydra.git#egg=pydra'
5166 steps :
5267 - name : Checkout
53- uses : actions/checkout@v3
54- - name : Revert version to most recent tag on upstream update
68+ uses : actions/checkout@v4
69+
70+ - name : Revert version to most recent version tag on Nipype or Nipype2Pydra update
5571 if : github.event_name == 'repository_dispatch'
56- run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
57- - name : Download tasks converted from Nipype
58- uses : actions/download-artifact@v3
72+ run : git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')
73+
74+ - name : Download tasks converted from Nipype
75+ uses : actions/download-artifact@v4
5976 with :
6077 name : converted-nipype
6178 path : pydra/tasks/afni/auto
6279 - name : Strip auto package from gitignore so it is included in package
6380 run : |
6481 sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore
82+ sed -i '/^_version.py/d' .gitignore
6583 - name : Set up Python ${{ matrix.python-version }}
66- uses : actions/setup-python@v4
84+ uses : actions/setup-python@v5
6785 with :
6886 python-version : ${{ matrix.python-version }}
87+
6988 - name : Install build dependencies
7089 run : |
7190 python -m pip install --upgrade pip
91+
7292 - name : Install Pydra
7393 run : |
7494 pushd $HOME
7595 pip install ${{ matrix.pydra }}
7696 popd
7797 python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
98+
7899 - name : Install task package
79100 run : |
80101 pip install "./related-packages/fileformats[dev]" "related-packages/fileformats-extras[dev]"
81102 pip install ${{ matrix.pip-flags }} ".[dev]"
82103 python -c "import pydra.tasks.afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
104+ python -c "import pydra.tasks.afni.auto as m; print(f'{m.__name__} @ {m.__file__}')"
83105 python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
84106 python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
85107 python -c "import fileformats.extras.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
88110 runs-on : ubuntu-latest
89111 strategy :
90112 matrix :
91- python-version : ['3.8', '3.11 ']
113+ python-version : ['3.8', '3.12 ']
92114 steps :
93115 - uses : actions/checkout@v3
94116 - name : Revert version to most recent tag on upstream update
@@ -106,77 +128,55 @@ jobs:
106128 pip install "./related-packages/fileformats[test]" "./related-packages/fileformats-extras[test]"
107129 python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
108130 - name : Test fileformats with pytest
109- run : |
110- cd ./fileformats
111- pytest -sv --cov fileformats.medimage_afni --cov fileformats.extras.medimage_afni --cov-report xml .
131+ run : >-
132+ pytest ./related-packages -sv --cov fileformats.medimage_afni
133+ --cov fileformats.extras.medimage_afni --cov-report xml .
112134
113135 test :
114- needs : [nipype-conv, fileformats-test ]
136+ needs : [nipype-conv]
115137 runs-on : ubuntu-22.04
116138 strategy :
117139 matrix :
118- python-version : ['3.8'] # '3.11'
140+ python-version : ['3.8', '3.12']
119141 steps :
120142 - name : Removed unnecessary tools to free space
121143 run : |
122144 sudo rm -rf /usr/share/dotnet
123145 sudo rm -rf "$AGENT_TOOLSDIRECTORY"
124- - name : Get Download cache Key
125- id : cache-key
126- run : echo "::set-output name=key::afni-linux-ubuntu22_amd64-7.4.1"
127- - name : Cache FreeSurfer
128- uses : actions/cache@v2
129- with :
130- path : $HOME/downloads/afni
131- key : ${{ steps.cache-key.outputs.key }}
132- restore-keys : |
133- afni-linux-ubuntu22_amd64-7.4.1
134- - name : Download FreeSurfer
135- if : steps.cache-key.outputs.key != steps.cache-hit.outputs.key
136- run : |
137- mkdir -p $HOME/downloads/afni
138- curl -s -o $HOME/downloads/afni/afni-linux-ubuntu22_amd64-7.4.1.tar.gz https://surfer.nmr.mgh.harvard.edu/pub/dist/afni/7.4.1/afni-linux-ubuntu22_amd64-7.4.1.tar.gz
139- shell : bash
140- - name : Install Freesurfer
141- env :
142- FREESURFER_LICENCE : ${{ secrets.FREESURFER_LICENCE }}
143- run : |
144- pushd $HOME/downloads/afni
145- tar -zxpf afni-linux-ubuntu22_amd64-7.4.1.tar.gz
146- mv afni $HOME/
147- popd
148- export FREESURFER_HOME=$HOME/afni
149- source $FREESURFER_HOME/SetUpFreeSurfer.sh
150- echo $FREESURFER_LICENCE > $FREESURFER_HOME/license.txt
151- export PATH=$FREESURFER_HOME/bin:$PATH
152- - uses : actions/checkout@v3
146+
147+ - uses : actions/checkout@v4
153148 - name : Revert version to most recent tag on upstream update
154149 if : github.event_name == 'repository_dispatch'
155- run : git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
156- - name : Download tasks converted from Nipype
157- uses : actions/download-artifact@v3
150+ run : git checkout $(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')
151+
152+ - name : Download tasks converted from Nipype
153+ uses : actions/download-artifact@v4
158154 with :
159155 name : converted-nipype
160156 path : pydra/tasks/afni/auto
157+ - name : Show package contents
158+ run : tree ./pydra
161159 - name : Strip auto package from gitignore so it is included in package
162160 run : |
163- sed -i '/\/src\/ pydra\/tasks\/afni\/auto/d' .gitignore
161+ sed -i '/\/pydra\/tasks\/afni\/auto/d' .gitignore
164162 - name : Set up Python ${{ matrix.python-version }}
165- uses : actions/setup-python@v4
163+ uses : actions/setup-python@v5
166164 with :
167165 python-version : ${{ matrix.python-version }}
166+
168167 - name : Install build dependencies
169168 run : |
170169 python -m pip install --upgrade pip
170+
171171 - name : Install task package
172172 run : |
173173 pip install "./related-packages/fileformats" "./related-packages/fileformats-extras" ".[test]"
174174 python -c "import pydra.tasks.afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
175+ python -c "import pydra.tasks.afni.auto as m; print(f'{m.__name__} @ {m.__file__}')"
175176 python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
176177 - name : Test with pytest
177178 run : |
178- pytest -sv --doctest-modules ./pydra/tasks/afni \
179- --cov pydra.tasks.afni --cov-report xml
179+ pytest -sv ./pydra/tasks/afni --cov pydra.tasks.afni --cov-report xml
180180 - uses : codecov/codecov-action@v3
181181 if : ${{ always() }}
182182 with :
@@ -256,7 +256,7 @@ jobs:
256256 submodules : recursive
257257 fetch-depth : 0
258258 - name : Download tasks converted from Nipype
259- uses : actions/download-artifact@v3
259+ uses : actions/download-artifact@v4
260260 with :
261261 name : converted-nipype
262262 path : pydra/tasks/afni/auto
@@ -282,7 +282,7 @@ jobs:
282282 run : python -m build .
283283 - name : Check distributions
284284 run : twine check dist/*
285- - uses : actions/upload-artifact@v3
285+ - uses : actions/upload-artifact@v4
286286 with :
287287 name : distributions
288288 path : dist/
0 commit comments