Skip to content

Commit

Permalink
Merge pull request #364 from effigies/ci/pytest-on-circle
Browse files Browse the repository at this point in the history
ENH: Run pytest on CircleCI
  • Loading branch information
effigies authored Aug 28, 2023
2 parents 506df71 + 601231e commit 244f1b2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ jobs:
paths:
- /home/circleci/.local

test_wrapper:
test:
<<: *machine_defaults
steps:
- attach_workspace:
Expand Down Expand Up @@ -321,6 +321,24 @@ jobs:
which smriprep-docker
smriprep-docker -i nipreps/smriprep:latest --help
smriprep-docker -i nipreps/smriprep:latest --version
- restore_cache:
keys:
- testdata-v2-{{ .Branch }}-{{ epoch }}
- testdata-v2-{{ .Branch }}
- testdata-v2-
- restore_cache:
keys:
- templateflow-v1-{{ .Branch }}-{{ epoch }}
- templateflow-v1-{{ .Branch }}
- templateflow-v1-
- run:
name: Run Pytest
no_output_timeout: 2h
command: |
bash /tmp/src/smriprep/.circleci/pytest.sh
- codecov/upload:
file: /tmp/data/pytest_cov.xml
flags: pytest

test_deploy_pypi:
<<: *python_defaults
Expand Down Expand Up @@ -789,7 +807,7 @@ workflows:
tags:
only: /.*/

- test_wrapper:
- test:
context:
- nipreps-common
requires:
Expand Down Expand Up @@ -848,7 +866,7 @@ workflows:
- build_docs
- ds005
- ds054
- test_wrapper
- test
filters:
branches:
only: /master/
Expand All @@ -861,7 +879,7 @@ workflows:
- ds005
- ds054
- test_deploy_pypi
- test_wrapper
- test
filters:
branches:
ignore: /.*/
Expand Down
13 changes: 13 additions & 0 deletions .circleci/pytest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
docker run --rm -it \
-v /tmp/data:/tmp/data:rw \
-v /tmp/fslicense:/tmp/fslicense:ro \
-v /tmp/templateflow:/home/smriprep/.cache/templateflow \
-v /tmp/src/smriprep/docker/multiproc.coveragerc:/tmp/multiproc.coveragerc:ro \
-v /tmp/src/smriprep/.circleci/nipype.cfg:/home/smriprep/.nipype/nipype.cfg \
-e FS_LICENSE=/tmp/fslicense/license.txt \
--entrypoint=pytest \
nipreps/smriprep:latest \
-v --doctest-modules --pyargs smriprep \
--cov smriprep --cov-report=xml:/tmp/data/pytest_cov.xml \
${@:1}

0 comments on commit 244f1b2

Please sign in to comment.