@@ -4,35 +4,59 @@ version: 2.1
44
55.dockersetup : &dockersetup
66 docker :
7- - image : pennlinc/babs_tests:datalad0.17.2_v5
8-
9- # TODO:
10- # runinstall: &runinstall
11- # name: Install BABS
12- # TODO: build; build_docs; see QSIPrep
13- # TODO: add tests from flake8
7+ - image : pennlinc/babs_testing:0.3
148
159jobs :
16- pytest : # run pytest
10+ download_test_data :
11+ << : *dockersetup
12+ resource_class : medium
13+ working_directory : /home/circleci/src/babs
14+ steps :
15+ - checkout :
16+ path : /home/circleci/src/babs
17+ - restore_cache :
18+ keys :
19+ - test-data-v1
20+ - run :
21+ name : Download test datasets
22+ command : |
23+ mkdir -p /home/circleci/test_data
24+ cd /home/circleci/test_data
25+ # Install datalad if not already in the image
26+ pip install datalad-osf
27+ # Download each dataset from origin_input_dataset.yaml
28+ python3 /home/circleci/src/babs/tests/download_datasets.py
29+ # Debug output
30+ echo "Contents of test_data directory:"
31+ ls -la /home/circleci/test_data/
32+ - save_cache :
33+ key : test-data-v1
34+ paths :
35+ - /home/circleci/test_data
36+
37+ pytest : # run pytest
1738 << : *dockersetup
1839 resource_class : xlarge
1940 working_directory : /home/circleci/src/babs
2041 steps :
2142 - checkout :
2243 path : /home/circleci/src/babs
44+ - restore_cache :
45+ keys :
46+ - test-data-v1
2347 - run :
2448 name : pytest of BABS
2549 no_output_timeout : 1h
2650 command : |
2751 pip install .[tests]
28- pytest -n 6 -sv
29-
30- deployable : # checkpoint of deployable: requires all success
52+ pytest -n 4 -sv --durations=0 --timeout=300 --log-cli-level=DEBUG
53+
54+ deployable : # checkpoint of deployable: requires all success
3155 << : *dockersetup
3256 steps :
3357 - run : echo Deploying!
3458
35- deploy_pypi : # deploy to pypi
59+ deploy_pypi : # deploy to pypi
3660 << : *dockersetup
3761 working_directory : /tmp/src/babs
3862 steps :
@@ -49,31 +73,32 @@ jobs:
4973 python3 -m twine upload dist/*
5074 # NOTE: if want to test with test pypi, add `--repository testpypi` after `twine upload`
5175
52-
5376workflows :
5477 # version: 2
5578 build_test_deploy :
5679 jobs :
57- # - build
58- # - build_docs
80+ - download_test_data :
81+ filters :
82+ tags :
83+ only : /.*/
5984 - pytest :
60- # requires:
61- # - build
85+ requires :
86+ - download_test_data
6287 filters :
6388 tags :
64- only : /.*/ # i.e., all branches and tags
89+ only : /.*/
6590 - deployable :
66- requires : # should require all jobs' success before deploying
91+ requires :
6792 - pytest
68- filters : # run when main branch + any tags
93+ filters :
6994 branches :
7095 only : main
7196 tags :
7297 only : /.*/
7398 - deploy_pypi :
7499 requires :
75100 - deployable
76- filters : # runs for no branches but runs for any tags
101+ filters :
77102 branches :
78103 ignore : /.*/
79104 tags :
0 commit comments