Skip to content

Commit eb23523

Browse files
committed
CI: Rework CI to use conda-installed Python/FSL
1 parent 6dcac6e commit eb23523

File tree

1 file changed

+47
-36
lines changed

1 file changed

+47
-36
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,37 @@ name: Python package
66
# Set once
77
env:
88
SUBPACKAGE: nipype1
9+
FSLCONDA: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/
910

1011
on:
1112
push:
12-
branches: [ main ]
13+
branches: [main]
1314
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}
1524

1625
jobs:
1726
devcheck:
1827
runs-on: ubuntu-latest
1928
strategy:
2029
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"]
2332
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"
2635

2736
steps:
28-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v4
2938
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
39+
uses: actions/setup-python@v5
3140
with:
3241
python-version: ${{ matrix.python-version }}
3342
- name: Install build dependencies
@@ -47,19 +56,24 @@ jobs:
4756
runs-on: ubuntu-latest
4857
strategy:
4958
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"]
5160

5261
steps:
53-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v4
5463
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v2
64+
uses: conda-incubator/setup-miniconda@v3
5665
with:
5766
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
6070
- 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
6377
run: |
6478
python -m pip install --upgrade pip
6579
- name: Install task package
@@ -69,34 +83,31 @@ jobs:
6983
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
7084
- name: Test with pytest
7185
run: |
72-
source /etc/fsl/fsl.sh
7386
pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
7487
--cov pydra.tasks.$SUBPACKAGE --cov-report xml
75-
- uses: codecov/codecov-action@v1
88+
- uses: codecov/codecov-action@v4
7689
if: ${{ always() }}
90+
with:
91+
token: ${{ secrets.CODECOV_TOKEN }}
7792

78-
deploy:
79-
needs: [ devcheck, test ]
93+
build:
8094
runs-on: ubuntu-latest
81-
strategy:
82-
matrix:
83-
python-version: [ '3.9' ]
8495
steps:
85-
- uses: actions/checkout@v2
96+
- uses: actions/checkout@v4
8697
with:
8798
submodules: recursive
8899
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
100110
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

Comments
 (0)