Skip to content

Commit 9852c82

Browse files
authored
[MAINT] split system and unit tests for matlab linux and mac os (#1309)
* split system and unit tests for matlab linux and mac os * move into a single workflow
1 parent d7014f0 commit 9852c82

File tree

1 file changed

+165
-43
lines changed

1 file changed

+165
-43
lines changed

.github/workflows/tests.yml

Lines changed: 165 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,57 +27,25 @@ on:
2727
schedule:
2828
- cron: 0 0 1,15 * *
2929

30-
# Allows you to run this workflow manually from the Actions tab
30+
# Allows you to run this workflow manually from the Actions tab
3131
workflow_dispatch:
3232

3333
jobs:
3434

35-
tests:
35+
fast_tests:
3636

3737
if: github.repository_owner == 'cpp-lln-lab'
3838

3939
strategy:
4040
matrix:
41-
test_type: [system]
42-
script: [moae, facerep, fmriprep]
4341
os: [ubuntu-latest, macos-13]
4442
matlab: [R2023b]
45-
include:
46-
# only run bms on ubuntu because of datalad setup
47-
- test_type: system
48-
os: ubuntu-latest
49-
matlab: R2023b
50-
script: bms
51-
- test_type: unit
52-
os: ubuntu-latest
53-
matlab: R2023b
54-
mode: fast
55-
- test_type: unit
56-
os: macos-13
57-
matlab: R2023b
58-
mode: fast
59-
- test_type: unit
60-
os: ubuntu-latest
61-
matlab: R2023b
62-
mode: slow
63-
- test_type: unit
64-
os: macos-13
65-
matlab: R2023b
66-
mode: slow
67-
- test_type: unit
68-
os: macos-13
69-
matlab: R2023b
70-
mode: fast
7143
fail-fast: false
7244

7345
runs-on: ${{ matrix.os }}
7446

7547
steps:
7648

77-
- name: ${{ matrix.test_type }} test
78-
if: matrix.test_type == 'system'
79-
run: echo ${{ matrix.test_type }} test ${{ matrix.script }}
80-
8149
- name: Install Node
8250
uses: actions/setup-node@v4
8351
with:
@@ -129,10 +97,6 @@ jobs:
12997
cd tests
13098
make data
13199
132-
- name: Get data for BMS
133-
if: matrix.script == 'bms'
134-
run: make -C demos/bayes data_ds000114
135-
136100
- name: Install Moxunit and MOcov
137101
run: |
138102
git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
@@ -144,29 +108,187 @@ jobs:
144108
release: ${{ matrix.matlab }}
145109

146110
- name: Run fast unit tests MATLAB
147-
if: matrix.test_type == 'unit' && matrix.mode == 'fast'
148111
uses: matlab-actions/[email protected]
149112
with:
150113
command: cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run tests_matlab;
151114

115+
- name: Code coverage matlab
116+
uses: codecov/codecov-action@v4
117+
with:
118+
file: coverage.xml
119+
flags: ${{ matrix.os }}_matlab-${{ matrix.matlab }}_fast
120+
name: codecov-matlab
121+
fail_ci_if_error: false
122+
token: ${{ secrets.CODECOV_TOKEN }}
123+
124+
slow_tests:
125+
126+
needs: [fast_tests]
127+
if: github.repository_owner == 'cpp-lln-lab'
128+
129+
strategy:
130+
matrix:
131+
os: [ubuntu-latest, macos-13]
132+
matlab: [R2023b]
133+
fail-fast: false
134+
135+
runs-on: ${{ matrix.os }}
136+
137+
steps:
138+
139+
- name: Install Node
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: 18
143+
144+
- name: Install python
145+
uses: actions/setup-python@v5
146+
with:
147+
python-version: '3.11'
148+
149+
- name: Install dependencies
150+
if: matrix.os == 'ubuntu-latest'
151+
run: |
152+
sudo apt-get -y -qq update
153+
sudo apt-get -y install unzip wget git-annex
154+
python -m pip install --upgrade pip setuptools
155+
pip install datalad
156+
157+
- name: Clone bidspm
158+
uses: actions/checkout@v4
159+
with:
160+
submodules: recursive
161+
fetch-depth: 0
162+
163+
- name: Install validators
164+
run: make install
165+
166+
- name: Install SPM
167+
run: |
168+
git clone https://github.com/spm/spm12.git --depth 1
169+
170+
- name: Get moae fmriprep data from OSF
171+
run: |
172+
mkdir -p demos/MoAE/inputs/
173+
cd demos/MoAE/inputs/
174+
wget https://osf.io/vufjs/download
175+
unzip download
176+
mv moae_fmriprep fmriprep
177+
178+
- name: Get data for testing QA
179+
if: matrix.os == 'ubuntu-latest'
180+
run: |
181+
cd demos/openneuro/
182+
make data_ds000114_mriqc
183+
make data_ds000114_fmriprep
184+
185+
- name: Prepare test data unix
186+
run: |
187+
cd tests
188+
make data
189+
190+
- name: Install Moxunit and MOcov
191+
run: |
192+
git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
193+
git clone https://github.com/MOcov/MOcov.git --depth 1
194+
195+
- name: Install MATLAB
196+
uses: matlab-actions/[email protected]
197+
with:
198+
release: ${{ matrix.matlab }}
199+
152200
- name: Run slow unit tests MATLAB
153-
if: matrix.test_type == 'unit' && matrix.mode == 'slow'
154201
uses: matlab-actions/[email protected]
155202
with:
156203
command: cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); global SLOW; SLOW=true; run tests_matlab;
157204

158205
- name: Code coverage matlab
159-
if: matrix.test_type == 'unit'
160206
uses: codecov/codecov-action@v4
161207
with:
162208
file: coverage.xml
163-
flags: ${{ matrix.os }}_matlab-${{ matrix.matlab }}_${{ matrix.mode }}
209+
flags: ${{ matrix.os }}_matlab-${{ matrix.matlab }}_slow
164210
name: codecov-matlab
165211
fail_ci_if_error: false
166212
token: ${{ secrets.CODECOV_TOKEN }}
167213

214+
system_tests:
215+
216+
needs: [fast_tests]
217+
if: github.repository_owner == 'cpp-lln-lab'
218+
219+
strategy:
220+
matrix:
221+
script: [moae, facerep, fmriprep]
222+
os: [ubuntu-latest, macos-13]
223+
matlab: [R2023b]
224+
include:
225+
# only run bms on ubuntu because of datalad setup
226+
- os: ubuntu-latest
227+
matlab: R2023b
228+
script: bms
229+
fail-fast: false
230+
231+
runs-on: ${{ matrix.os }}
232+
233+
steps:
234+
235+
- name: test ${{ matrix.script }}
236+
run: test ${{ matrix.script }}
237+
238+
- name: Install Node
239+
uses: actions/setup-node@v4
240+
with:
241+
node-version: 18
242+
243+
- name: Install python
244+
uses: actions/setup-python@v5
245+
with:
246+
python-version: '3.11'
247+
248+
- name: Install dependencies
249+
if: matrix.os == 'ubuntu-latest'
250+
run: |
251+
sudo apt-get -y -qq update
252+
sudo apt-get -y install unzip wget git-annex
253+
python -m pip install --upgrade pip setuptools
254+
pip install datalad
255+
256+
- name: Clone bidspm
257+
uses: actions/checkout@v4
258+
with:
259+
submodules: recursive
260+
fetch-depth: 0
261+
262+
- name: Install validators
263+
run: make install
264+
265+
- name: Install SPM
266+
run: |
267+
git clone https://github.com/spm/spm12.git --depth 1
268+
269+
- name: Get moae fmriprep data from OSF
270+
run: |
271+
mkdir -p demos/MoAE/inputs/
272+
cd demos/MoAE/inputs/
273+
wget https://osf.io/vufjs/download
274+
unzip download
275+
mv moae_fmriprep fmriprep
276+
277+
- name: Prepare test data unix
278+
run: |
279+
cd tests
280+
make data
281+
282+
- name: Get data for BMS
283+
if: matrix.script == 'bms'
284+
run: make -C demos/bayes data_ds000114
285+
286+
- name: Install MATLAB
287+
uses: matlab-actions/[email protected]
288+
with:
289+
release: ${{ matrix.matlab }}
290+
168291
- name: Run system tests MATLAB ${{ matrix.script }}
169-
if: matrix.test_type == 'system'
170292
uses: matlab-actions/[email protected]
171293
with:
172294
command: cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run system_tests_${{ matrix.script }};

0 commit comments

Comments
 (0)