Skip to content

Commit

Permalink
[FIX 🔨] circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
saratheriver committed Dec 14, 2020
1 parent 06304eb commit 39f1017
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 9 deletions.
145 changes: 136 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,140 @@
# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2.1
# Use a package of configuration called an orb.

orbs:
# Declare a dependency on the welcome-orb
welcome: circleci/[email protected]
# Orchestrate or schedule a set of jobs
codecov: codecov/[email protected]

commands:
gettenv:
description: "Get/build environment"
parameters:
env:
type: string
version:
type: string
steps:
- restore_cache:
key: conda-<< parameters.env >>-v1-{{ checksum "dev_requirements.txt" }}
- run:
name: Generate environment
command: |
if [ ! -d ~/opt/anaconda3/envs/enigma_<< parameters.env >> ]; then
apt-get update
apt-get install -yqq build-essential libsnappy-dev
conda create -yq -n enigma_<< parameters.env >> python=<< parameters.version >>
source activate enigma_<< parameters.env >>
pip install -r dev_requirements.txt
fi
- save_cache:
key: conda-<< parameters.env >>-v1-{{ checksum "dev_requirements.txt" }}
paths:
- /opt/conda/envs/enigma_<< parameters.env >>
rununit:
description: "Run unit tests for enigma"
parameters:
env:
type: string
steps:
- run:
no_output_timeout: 40m
command: |
source activate enigma_<< parameters.env >>
pip install -e .
mkdir for_testing && cd for_testing
cp ../setup.cfg .
pytest --durations=5 --cov-report term-missing --cov=enigma --doctest-modules --pyargs abagen
mkdir /tmp/src/coverage
mv .coverage /tmp/src/coverage/.coverage.<< parameters.env >>
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.<< parameters.env >>

executors:
conda_exec:
docker:
- image: continuumio/miniconda3
environment:
ABAGEN_DATA: /tmp/src/data
working_directory: /tmp/src/enigma

jobs:
makeenv_py37:
executor: conda_exec
steps:
- checkout
- gettenv:
env: "py37"
version: "3.7"
- persist_to_workspace:
root: /tmp
paths:
- src/enigma
unittest_py36:
executor: conda_exec
steps:
- attach_workspace:
at: /tmp
- gettenv:
env: "py36"
version: "3.6"
- rununit:
env: "py36"
unittest_py37:
executor: conda_exec
steps:
- attach_workspace:
at: /tmp
- gettenv:
env: "py37"
version: "3.7"
- rununit:
env: "py37"
unittest_py38:
executor: conda_exec
steps:
- attach_workspace:
at: /tmp
- gettenv:
env: "py38"
version: "3.8"
- rununit:
env: "py38"
merge_coverage:
executor: conda_exec
steps:
- attach_workspace:
at: /tmp
- gettenv:
env: "py37"
version: "3.7"
- run:
name: Merge coverage files
command: |
apt-get update
apt-get install -yqq curl
source activate abagen_py37
cd /tmp/src/coverage
coverage combine
coverage xml
- store_artifacts:
path: /tmp/src/coverage
- codecov/upload:
file: /tmp/src/coverage/coverage.xml

workflows:
# Name the workflow "welcome"
welcome:
# Run the welcome/run job in its own container
version: 2.1
build_test:
jobs:
- welcome/run
- makeenv_py37
- unittest_py36:
- unittest_py37:
- unittest_py38:
- merge_coverage:
requires:
- unittest_py36
- unittest_py37
- unittest_py38
9 changes: 9 additions & 0 deletions .circleci/dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-r requirements.txt
fastparquet
flake8
python-snappy
pytest>=3.6
pytest-cov
sphinx>=2.0
sphinx-argparse
sphinx_rtd_theme

0 comments on commit 39f1017

Please sign in to comment.