-
-
Notifications
You must be signed in to change notification settings - Fork 18
124 lines (110 loc) · 3.8 KB
/
build-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build, test
on:
push:
branch: main
pull_request:
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
env:
ANTSPATH: /opt/ants
FSLPATH: /opt/fsl
FSLDIR: /opt/fsl
FSLOUTPUTTYPE: NIFTI_GZ
steps:
- name: Cache Ubuntu dependencies
uses: actions/cache@v2
with:
path: /var/lib/apt
key: apt-cache-v1
restore-keys: |
apt-cache-v1
- name: Install Ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
bc \
bzip2 \
ca-certificates \
curl \
dc \
file \
libfontconfig1 \
libfreetype6 \
libgl1-mesa-dev \
libgl1-mesa-dri \
libglu1-mesa-dev \
libgomp1 \
libice6 \
libxcursor1 \
libxft2 \
libxinerama1 \
libxrandr2 \
libxrender1 \
libxt6
- name: Cache ANTs install
uses: actions/cache@v2
with:
path: /opt/ants
key: ants-v1
restore-keys: |
ants-v1
- name: Install ANTs
run: |
if [[ ! -d "${ANTSPATH}" ]]; then
sudo mkdir -p $ANTSPATH
curl -sSL "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" | sudo tar -xzC $ANTSPATH --strip-components 1
fi
- name: Cache FSL install
uses: actions/cache@v2
with:
path: /opt/fsl
key: fsl-v2
restore-keys: |
fsl-v2
- name: Install FSL
run: |
if [[ ! -d "${FSLPATH}" ]]; then
sudo mkdir -p $FSLPATH
curl -sSL "https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.2-centos6_64.tar.gz" | sudo tar -xzC $FSLPATH --strip-components 1
sudo bash ${FSLPATH}/etc/fslconf/fslpython_install.sh -f $FSLPATH
sudo rm -rf ${FSLPATH}/data/atlases
fi
- name: Checkout GitHub repository
uses: actions/checkout@v2
- name: Install dependencies for headless display
run: |
${{ github.workspace }}/.github/scripts/setup_headless.sh
# Run with multiple Python versions
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python requirements
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest nbmake
- name: Download data
run: |
pushd `pwd`
cd ${{ github.workspace }}/data
osf -p cmq8a fetch ds000221_subject/ds000221_sub-010006.zip
unzip ds000221_sub-010006.zip
rm ds000221_sub-010006.zip
popd
- name: Run pytest on Jupyter notebooks
run: |
export PYTHONPATH=$PYTHONPATH:`realpath ${{ github.workspace }}`
export PATH=/opt/fsl/bin:/opt/ants:$PATH
pytest --nbmake -v code/introduction.ipynb
pytest --nbmake --nbmake-timeout=5400 -v code/preprocessing.ipynb
pytest --nbmake -v code/diffusion_tensor_imaging.ipynb
pytest --nbmake -v code/constrained_spherical_deconvolution.ipynb
pytest --nbmake -v code/deterministic_tractography.ipynb
pytest --nbmake -n=2 -v code/probabilistic_tractography.ipynb