Skip to content

Commit

Permalink
maint: update circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Sep 13, 2024
1 parent 6de35f8 commit d2c8c12
Showing 1 changed file with 23 additions and 30 deletions.
53 changes: 23 additions & 30 deletions .circleci/config.yml
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:
Expand All @@ -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: |
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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/*
Expand Down

0 comments on commit d2c8c12

Please sign in to comment.