@@ -6,28 +6,37 @@ name: Python package
6
6
# Set once
7
7
env :
8
8
SUBPACKAGE : nipype1
9
+ FSLCONDA : https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/
9
10
10
11
on :
11
12
push :
12
- branches : [ main ]
13
+ branches : [main]
13
14
pull_request :
14
- branches : [ main ]
15
+ branches : [main]
16
+
17
+ concurrency :
18
+ group : ${{ github.workflow }}-${{ github.ref }}
19
+ cancel-in-progress : true
20
+
21
+ defaults :
22
+ run :
23
+ shell : bash -el {0}
15
24
16
25
jobs :
17
26
devcheck :
18
27
runs-on : ubuntu-latest
19
28
strategy :
20
29
matrix :
21
- python-version : [ '3.7', '3.11' ] # Check oldest and newest versions
22
- pip-flags : [ '', ' --editable' ]
30
+ python-version : ["3.8", "3.12"] # Check oldest and newest versions
31
+ pip-flags : ["", " --editable" ]
23
32
pydra :
24
- - ' pydra'
25
- - ' --editable git+https://github.com/nipype/pydra.git#egg=pydra'
33
+ - " pydra"
34
+ - " --editable git+https://github.com/nipype/pydra.git#egg=pydra"
26
35
27
36
steps :
28
- - uses : actions/checkout@v2
37
+ - uses : actions/checkout@v4
29
38
- name : Set up Python ${{ matrix.python-version }}
30
- uses : actions/setup-python@v2
39
+ uses : actions/setup-python@v5
31
40
with :
32
41
python-version : ${{ matrix.python-version }}
33
42
- name : Install build dependencies
@@ -47,19 +56,24 @@ jobs:
47
56
runs-on : ubuntu-latest
48
57
strategy :
49
58
matrix :
50
- python-version : [ '3.7', '3.8', ' 3.9', ' 3.10', ' 3.11' ]
59
+ python-version : ["3.8", " 3.9", " 3.10", " 3.11", "3.12" ]
51
60
52
61
steps :
53
- - uses : actions/checkout@v2
62
+ - uses : actions/checkout@v4
54
63
- name : Set up Python ${{ matrix.python-version }}
55
- uses : actions /setup-python@v2
64
+ uses : conda-incubator /setup-miniconda@v3
56
65
with :
57
66
python-version : ${{ matrix.python-version }}
58
- - name : Set up NeuroDebian
59
- run : bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
67
+ mamba-version : " *"
68
+ channels : ${{ env.FSLCONDA }},conda-forge,defaults
69
+ channel-priority : true
60
70
- name : Install FSL
61
- run : sudo apt-get install -y fsl
62
- - name : Install build dependencies
71
+ run : |
72
+ mamba install fsl-avwutils
73
+ mamba env config vars set FSLDIR="$CONDA_PREFIX" FSLOUTPUTTYPE="NIFTI_GZ"
74
+ # Hack because we're not doing a full FSL install
75
+ echo "6.0.7.9" > $CONDA_PREFIX/etc/fslversion
76
+ - name : Upgrade pip
63
77
run : |
64
78
python -m pip install --upgrade pip
65
79
- name : Install task package
@@ -69,34 +83,31 @@ jobs:
69
83
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
70
84
- name : Test with pytest
71
85
run : |
72
- source /etc/fsl/fsl.sh
73
86
pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
74
87
--cov pydra.tasks.$SUBPACKAGE --cov-report xml
75
- - uses : codecov/codecov-action@v1
88
+ - uses : codecov/codecov-action@v4
76
89
if : ${{ always() }}
90
+ with :
91
+ token : ${{ secrets.CODECOV_TOKEN }}
77
92
78
- deploy :
79
- needs : [ devcheck, test ]
93
+ build :
80
94
runs-on : ubuntu-latest
81
- strategy :
82
- matrix :
83
- python-version : [ '3.9' ]
84
95
steps :
85
- - uses : actions/checkout@v2
96
+ - uses : actions/checkout@v4
86
97
with :
87
98
submodules : recursive
88
99
fetch-depth : 0
89
- - name : Set up Python ${{ matrix.python-version }}
90
- uses : actions/setup-python@v2
91
- with :
92
- python-version : ${{ matrix.python-version }}
93
- - name : Install build tools
94
- run : python -m pip install build twine
95
- - name : Build source and wheel distributions
96
- run : python -m build
97
- - name : Check distributions
98
- run : twine check dist/*
99
- - uses : actions/upload-artifact@v2
100
+ - uses : hynek/build-and-inspect-python-package@v2
101
+
102
+ deploy :
103
+ needs : [build, devcheck, test]
104
+ runs-on : ubuntu-latest
105
+ permissions :
106
+ id-token : write
107
+ if : github.repository_owner == 'nipype' && github.event.action == 'published'
108
+ steps :
109
+ - uses : actions/download-artifact@v4
100
110
with :
101
- name : distributions
102
- path : dist/
111
+ name : Packages
112
+ path : dist
113
+ - uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments