@@ -66,13 +66,61 @@ jobs:
6666 # paths:
6767 # - cache/docker.tar.gz
6868
69+ get_data :
70+ machine :
71+ # Ubuntu 14.04 with Docker 17.10.0-ce
72+ image : circleci/classic:201711-01
73+ working_directory : /home/circleci/data
74+ steps :
75+ - restore_cache :
76+ keys :
77+ - data-v1-{{ epoch }}
78+ - data-v1-
79+ - run :
80+ name : Get test data from ds000003
81+ command : |
82+ mkdir -p /tmp/data
83+ if [[ ! -d /tmp/data/ds003_downsampled ]]; then
84+ wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \
85+ -O ds003_downsampled.tar.gz "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/57f328f6b83f6901ef94cf70"
86+ tar xvzf ds003_downsampled.tar.gz -C /tmp/data/
87+ else
88+ echo "Dataset ds000003 was cached"
89+ fi
90+ - run :
91+ name : Get BIDS test data stub
92+ command : |
93+ mkdir -p /tmp/data
94+ if [[ ! -d /tmp/data/BIDS-examples-1-enh-ds054 ]]; then
95+ wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \
96+ -O BIDS-examples-1-enh-ds054.zip "http://github.com/chrisfilo/BIDS-examples-1/archive/enh/ds054.zip"
97+ unzip BIDS-examples-1-enh-ds054.zip -d /tmp/data/
98+ else
99+ echo "BIDS stub was cached"
100+ fi
101+ - run :
102+ name : Store FreeSurfer license file
103+ command : |
104+ mkdir -p /tmp/fslicense
105+ printf "$FS_LICENSE_CONTENT" | base64 -d >> /tmp/fslicense/license.txt
106+ - persist_to_workspace :
107+ root : /tmp
108+ paths :
109+ - data
110+ - fslicense
111+ - save_cache :
112+ key : data-v1-{{ epoch }}
113+ paths :
114+ - /tmp/data
115+
116+
69117 test_pytest :
70118 machine :
71119 image : circleci/classic:201711-01
72120 working_directory : /tmp/tests
73121 steps :
74- # - attach_workspace:
75- # at: /tmp
122+ - attach_workspace :
123+ at : /tmp
76124 - restore_cache :
77125 keys :
78126 - docker-v1-{{ .Branch }}-{{ epoch }}
@@ -92,11 +140,6 @@ jobs:
92140 pigz -d --stdout /tmp/cache/docker.tar.gz | docker load
93141 docker images
94142 fi
95- - run :
96- name : Store FreeSurfer license file
97- command : |
98- mkdir -p /tmp/fslicense
99- printf "$FS_LICENSE_CONTENT" | base64 -d >> /tmp/fslicense/license.txt
100143 - run :
101144 name : Set PR number
102145 command : |
@@ -113,6 +156,7 @@ jobs:
113156 sudo setfacl -d -m group:ubuntu:rwx $PWD
114157 sudo setfacl -m group:ubuntu:rwx $PWD
115158 docker run -it --rm=false \
159+ -e TEST_DATA_HOME=/data -v /tmp/data:/data \
116160 -v ${PWD}:/tmp niworkflows:py3 \
117161 pytest --junit-xml=/tmp/pytest.xml \
118162 --cov niworkflows --cov-report xml:/tmp/unittests.xml \
@@ -132,6 +176,7 @@ jobs:
132176 command : |
133177 docker run -it --rm=false \
134178 -e SAVE_CIRCLE_ARTIFACTS="/tmp" \
179+ -e TEST_DATA_HOME=/data -v /tmp/data:/data \
135180 -v /tmp/fslicense/license.txt:/opt/freesurfer/license.txt:ro \
136181 -v ${PWD}:/tmp niworkflows:py3 \
137182 pytest -n auto --junit-xml=/tmp/reportlets.xml \
@@ -174,18 +219,22 @@ workflows:
174219 filters :
175220 tags :
176221 only : /.*/
222+ - get_data :
223+ filters :
224+ tags :
225+ only : /.*/
177226
178227 - test_pytest :
179228 requires :
180229 - build
230+ - get_data
181231 filters :
182232 branches :
183233 ignore : /docs?\/.*/
184234 tags :
185235 only : /.*/
186236 - deploy :
187237 requires :
188- - build
189238 - test_pytest
190239 filters :
191240 branches :
0 commit comments