Skip to content

Commit 5a4ad3a

Browse files
authored
Merge pull request #322 from effigies/ci/update_packages
CI: Switch to miniconda setup, install fsl tools through conda
2 parents 308c95d + 142f413 commit 5a4ad3a

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

.github/workflows/unittests.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ concurrency:
1313
permissions:
1414
contents: read
1515

16+
defaults:
17+
run:
18+
shell: bash -el {0}
19+
1620
jobs:
1721
build-linux:
1822
if: "!contains(github.event.head_commit.message, '[skip ci]' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'nipreps/sdcflows'))"
19-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-latest
2024
env:
2125
TEST_DATA_HOME: /home/runner/sdcflows-tests
22-
FSLDIR: /usr/share/fsl/5.0
2326
FSLOUTPUTTYPE: NIFTI_GZ
2427
FSLMULTIFILEQUIT: TRUE
25-
POSSUMDIR: /usr/share/fsl/5.0
26-
FSLTCLSH: /usr/bin/tclsh
27-
FSLWISH: /usr/bin/wish
2828
AFNI_HOME: /opt/afni
2929
AFNI_MODELPATH: /opt/afni/models
3030
AFNI_IMSAVE_WARNINGS: NO
@@ -34,15 +34,15 @@ jobs:
3434
strategy:
3535
max-parallel: 5
3636
matrix:
37-
python-version: [3.7, 3.8, 3.9]
37+
python-version: [3.8, 3.9]
3838

3939
steps:
4040
- uses: actions/cache@v3
4141
with:
4242
path: /var/lib/apt
43-
key: apt-cache-v2
43+
key: apt-cache-v3
4444
restore-keys: |
45-
apt-cache-v2
45+
apt-cache-v3
4646
- name: Install dependencies
4747
run: |
4848
sudo apt-get update
@@ -53,10 +53,6 @@ jobs:
5353
libglu1-mesa-dev libglw1-mesa \
5454
libxm4 build-essential
5555
56-
- name: Install FSL
57-
run: |
58-
sudo apt-get install -y --no-install-recommends fsl
59-
6056
- uses: actions/cache@v3
6157
with:
6258
path: /opt/afni
@@ -88,28 +84,36 @@ jobs:
8884
git config --global user.name 'NiPreps Bot'
8985
git config --global user.email '[email protected]'
9086
- name: Set up Python ${{ matrix.python-version }}
91-
uses: actions/setup-python@v4
87+
uses: conda-incubator/setup-miniconda@v2
9288
with:
89+
auto-update-conda: true
90+
auto-activate-base: true
9391
python-version: ${{ matrix.python-version }}
92+
channels: anaconda,https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/,conda-forge
9493
- uses: actions/cache@v3
9594
id: conda
95+
env:
96+
CACHE_NUM: v4
9697
with:
9798
path: |
98-
/usr/share/miniconda/pkgs
99+
~/conda_pkgs_dir
99100
/home/runner/.cache/pip
100-
key: python-${{ matrix.python-version }}-v3
101+
key: python-${{ matrix.python-version }}-${{ env.CACHE_NUM }}
101102
restore-keys: |
102-
python-${{ matrix.python-version }}-v3
103+
python-${{ matrix.python-version }}-${{ env.CACHE_NUM }}
103104
- name: Install DataLad
104105
run: |
105-
$CONDA/bin/conda install -c conda-forge git-annex datalad pip
106-
$CONDA/bin/pip install datalad-osf
106+
conda install git-annex datalad pip
107+
pip install datalad-osf
108+
- name: Install fsl
109+
run: |
110+
conda install fsl-fugue fsl-topup
107111
- uses: actions/checkout@v3
108112
- name: Install minimal dependencies
109113
timeout-minutes: 5
110114
run: |
111-
$CONDA/bin/pip install -r min-requirements.txt
112-
$CONDA/bin/pip install .[tests]
115+
pip install -r min-requirements.txt
116+
pip install .[tests]
113117
114118
115119
- uses: actions/cache@v3
@@ -120,7 +124,7 @@ jobs:
120124
tf-cache-
121125
- name: Get TemplateFlow's required objects
122126
run: |
123-
$CONDA/bin/python tools/cache_templateflow.py
127+
python tools/cache_templateflow.py
124128
125129
- uses: actions/cache@v3
126130
with:
@@ -130,7 +134,6 @@ jobs:
130134
data-cache-
131135
- name: Install test data
132136
run: |
133-
export PATH=$CONDA/bin:$PATH
134137
mkdir -p ${{ env.TEST_DATA_HOME }}
135138
cd ${{ env.TEST_DATA_HOME }}
136139
@@ -173,9 +176,9 @@ jobs:
173176
run: |
174177
export LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH
175178
export PATH=$ANTSPATH:${AFNI_HOME}:/usr/lib/fsl/5.0:$PATH
176-
$CONDA/bin/pytest -v --cov sdcflows --cov-report xml:cov.xml --doctest-modules sdcflows
179+
pytest -v --cov sdcflows --cov-report xml:cov.xml --doctest-modules sdcflows
177180
178181
- name: Submit code coverage
179182
run: |
180-
$CONDA/bin/conda install codecov
181-
$CONDA/bin/python -m codecov --flags travis --file cov.xml -e $GITHUB_RUN_NUMBER
183+
pip install codecov
184+
python -m codecov --flags travis --file cov.xml -e $GITHUB_RUN_NUMBER

0 commit comments

Comments
 (0)