Skip to content

Commit 074d97a

Browse files
effigiesoesteban
authored andcommitted
CI: Add regression test steps
1 parent d0a4529 commit 074d97a

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.circleci/config.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,46 @@ jobs:
156156
- /tmp/data
157157
- /tmp/ds005/derivatives/freesurfer
158158

159+
get_regression_data:
160+
machine:
161+
# Ubuntu 14.04 with Docker 17.10.0-ce
162+
image: circleci/classic:201711-01
163+
working_directory: /home/circleci/data
164+
steps:
165+
- restore_cache:
166+
keys:
167+
- regression-v0-{{ epoch }}
168+
- regression-v0-
169+
- run:
170+
name: Get truncated BOLD series
171+
command: |
172+
mkdir -p /tmp/data
173+
if [[ ! -d /tmp/data/fmriprep_bold_truncated ]]; then
174+
wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \
175+
-O fmriprep_bold_truncated.tar.gz "https://osf.io/286yr/download"
176+
tar xvzf fmriprep_bold_truncated.tar.gz -C /tmp/data/
177+
else
178+
echo "Truncated BOLD series were cached"
179+
fi
180+
- run:
181+
name: Get pre-computed masks
182+
command: |
183+
if [[ ! -d /tmp/data/fmriprep_bold_mask ]]; then
184+
wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \
185+
-O fmriprep_bold_mask.tar.gz "https://osf.io/s4f7b/download"
186+
tar xvzf fmriprep_bold_mask.tar.gz -C /tmp/data/
187+
else
188+
echo "Pre-computed masks were cached"
189+
fi
190+
- persist_to_workspace:
191+
root: /tmp
192+
paths:
193+
- data
194+
- save_cache:
195+
key: regression-v0-{{ epoch }}
196+
paths:
197+
- /tmp/data
198+
159199
update_cache:
160200
machine:
161201
# Ubuntu 14.04 with Docker 17.10.0-ce
@@ -274,6 +314,28 @@ jobs:
274314
- store_artifacts:
275315
path: /home/circleci/out/docs
276316

317+
regression_test:
318+
machine:
319+
image: circleci/classic:201711-01
320+
working_directory: /tmp/regression
321+
steps:
322+
- checkout:
323+
path: /home/circleci/src/fmriprep
324+
- run:
325+
name: Check whether build should be skipped
326+
command: |
327+
cd /home/circleci/src/fmriprep
328+
if [[ "$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[skip[ _]?reg\]' )" != "" ]]; then
329+
echo "Skipping regression tests"
330+
circleci step halt
331+
fi
332+
- attach_workspace:
333+
at: /tmp
334+
- restore_cache:
335+
keys:
336+
- regression-v0-{{ epoch }}
337+
- regression-v0-
338+
277339
ds005:
278340
machine:
279341
image: circleci/classic:201711-01
@@ -665,6 +727,11 @@ workflows:
665727
tags:
666728
only: /.*/
667729

730+
- get_regression_data:
731+
filters:
732+
branches:
733+
ignore: /docs?\/.*/
734+
668735
- build_docs:
669736
requires:
670737
- build
@@ -721,6 +788,15 @@ workflows:
721788
tags:
722789
only: /.*/
723790

791+
- regression_test:
792+
requires:
793+
- build
794+
- get_regression_data
795+
filters:
796+
branches:
797+
# only: /meepi.*/
798+
ignore: /docs?\/.*/
799+
724800
- deploy:
725801
requires:
726802
- build

0 commit comments

Comments
 (0)