-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
version: 2 | ||
version: 2.1 | ||
orbs: | ||
docker: circleci/[email protected] | ||
codecov: codecov/[email protected] | ||
|
||
jobs: | ||
tests: | ||
docker: | ||
- image: cimg/python:3.11 | ||
- image: cimg/python:3.12 | ||
auth: | ||
username: $DOCKER_USER | ||
password: $DOCKER_PAT | ||
working_directory: /tmp/tests | ||
|
||
environment: | ||
- OSF_MIRROR_PATH: /tmp/data/templateflow | ||
steps: | ||
|
@@ -20,19 +25,9 @@ jobs: | |
- restore_cache: | ||
keys: | ||
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }} | ||
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}- | ||
- deps-v11- | ||
- run: | ||
name: Prepare environment | ||
command: | | ||
python -m venv /tmp/venv | ||
source /tmp/venv/bin/activate | ||
python -m pip install -U pip | ||
python -m pip install -r /tmp/src/templateflow/dev-requirements.txt | ||
python -m pip install -U "datalad ~= 0.19.0" | ||
python -m pip install -U build hatch twine pkginfo codecov | ||
- deps-v12-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }} | ||
- deps-v12-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}- | ||
- deps-v12- | ||
- run: | ||
name: Install git and git-annex | ||
command: | | ||
|
@@ -49,39 +44,43 @@ jobs: | |
git config --global user.name "First Last" | ||
git config --global user.email "[email protected]" | ||
- run: | ||
name: Prepare environment | ||
command: | | ||
python -m pip install -U pip | ||
python -m pip install -r /tmp/src/templateflow/dev-requirements.txt | ||
python -m pip install -U datalad | ||
python -m pip install -U build hatch twine pkginfo codecov | ||
- save_cache: | ||
key: deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }} | ||
key: deps-v12-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }} | ||
paths: | ||
- "/tmp/cache" | ||
- "/tmp/venv" | ||
- "/home/circleci/.pyenv" | ||
|
||
- run: | ||
name: Test packaging | ||
command: | | ||
source /tmp/venv/bin/activate | ||
cd /tmp/src/templateflow | ||
python -m build | ||
python -m twine check dist/* | ||
- run: | ||
name: Run tests (w/ DataLad) | ||
command: | | ||
source /tmp/venv/bin/activate | ||
export TEMPLATEFLOW_USE_DATALAD=on | ||
pytest --junit-xml=/tmp/tests/datalad.xml --cov templateflow --cov-report xml:/tmp/cov_api_dl.xml \ | ||
--doctest-modules /tmp/src/templateflow/templateflow | ||
- run: | ||
name: Submit api test coverage | ||
command: | | ||
source /tmp/venv/bin/activate | ||
codecov --file /tmp/cov_api_dl.xml --root /tmp/src/templateflow \ | ||
--flags api,datalad -e CIRCLE_JOB | ||
- run: | ||
name: Run tests (pulling from S3) | ||
command: | | ||
source /tmp/venv/bin/activate | ||
export TEMPLATEFLOW_USE_DATALAD=off | ||
export TEMPLATEFLOW_HOME=$HOME/templateflow-s3 | ||
pytest --junit-xml=/tmp/tests/s3.xml --cov templateflow --cov-report xml:/tmp/cov_api_s3.xml \ | ||
|
@@ -90,14 +89,12 @@ jobs: | |
- run: | ||
name: Submit api test coverage | ||
command: | | ||
source /tmp/venv/bin/activate | ||
codecov --file /tmp/cov_api_s3.xml --root /tmp/src/templateflow \ | ||
--flags api,s3 -e CIRCLE_JOB | ||
- run: | ||
name: Run tests (w/ DataLad, bypassed via S3) | ||
command: | | ||
source /tmp/venv/bin/activate | ||
export TEMPLATEFLOW_USE_DATALAD=off | ||
export TEMPLATEFLOW_HOME=$HOME/templateflow-clean | ||
datalad install -r -s https://github.com/templateflow/templateflow $TEMPLATEFLOW_HOME | ||
|
@@ -107,21 +104,18 @@ jobs: | |
- run: | ||
name: Submit api test coverage | ||
command: | | ||
source /tmp/venv/bin/activate | ||
codecov --file /tmp/cov_api_dl_s3.xml --root /tmp/src/templateflow \ | ||
--flags api,dls3 -e CIRCLE_JOB | ||
- run: | ||
name: Run tests (config, parameterized TEMPLATEFLOW_USE_DATALAD) | ||
command: | | ||
source /tmp/venv/bin/activate | ||
pytest --junit-xml=/tmp/tests/conftests.xml --cov templateflow --cov-report xml:/tmp/cov_config.xml \ | ||
/tmp/src/templateflow/templateflow/conf/tests/test_conf.py | ||
- run: | ||
name: Submit config test coverage | ||
command: | | ||
source /tmp/venv/bin/activate | ||
codecov --file /tmp/cov_config.xml --root /tmp/src/templateflow \ | ||
--flags config -e CIRCLE_JOB | ||
|
@@ -197,14 +191,13 @@ jobs: | |
- restore_cache: | ||
keys: | ||
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }} | ||
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}- | ||
- deps-v11- | ||
- deps-v12-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }} | ||
- deps-v12-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}- | ||
- deps-v12- | ||
|
||
- run: | ||
name: Deploy to PyPi | ||
command: | | ||
source /tmp/venv/bin/activate | ||
python -m pip install build -U twine pkginfo | ||
python -m build | ||
python -m twine check dist/* | ||
|