Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #153 from andersy005/ci-improvements
Browse files Browse the repository at this point in the history
Update CI
  • Loading branch information
andersy005 authored Oct 23, 2019
2 parents 12b7cb8 + 4885ffc commit 35ce76b
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 24 deletions.
42 changes: 34 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ workflows:
jobs:
- "python-3.6"
- "python-3.7"
# - "python-3.8"
- "dev"
- "docs-build"
- "linting"

default-job: &default-job
docker:
- image: conda/miniconda3:latest
- image: continuumio/miniconda3:latest
steps:
- checkout
- restore_cache:
Expand All @@ -25,8 +27,15 @@ default-job: &default-job
- save_cache:
key: deps-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_JOB }}
paths:
- "/usr/local/envs/${ENV_NAME}/"
- "/usr/local/pkgs"
- "/opt/conda/envs/${ENV_NAME}/"
- "/opt/conda/pkgs"

- store_test_results:
path: test-reports

- store_artifacts:
path: test-reports



jobs:
Expand All @@ -44,6 +53,20 @@ jobs:
ENV_NAME: "esmlab-dev"
TEST_SCRIPT: "run-checks.sh"

"dev":
<<: *default-job
environment:
PYTHON: "3.7-dev"
ENV_NAME: "esmlab-dev"
TEST_SCRIPT: "run-checks.sh"

# "python-3.8":
# <<: *default-job
# environment:
# PYTHON: "3.8"
# ENV_NAME: "esmlab-dev"
# TEST_SCRIPT: "run-checks.sh"

"linting":
<<: *default-job
environment:
Expand All @@ -54,10 +77,9 @@ jobs:

"docs-build":
docker:
- image: conda/miniconda3:latest
- image: continuumio/miniconda3:latest

environment:
PYTHON: "3.7"
ENV_NAME: "esmlab-dev"

steps:
Expand All @@ -69,7 +91,11 @@ jobs:
key: deps-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_JOB }}
- run: # install and activate conda environment
name: Install conda environment
command: ./ci/install-circle.sh
command: |
conda env update -f ./docs/environment.yml
source activate ${ENV_NAME}
python setup.py install
- run:
name: Check documentation build
command: |
Expand All @@ -81,8 +107,8 @@ jobs:
- save_cache:
key: deps-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_JOB }}
paths:
- "/usr/local/envs/${ENV_NAME}/"
- "/usr/local/pkgs"
- "/opt/conda/envs/${ENV_NAME}/"
- "/opt/conda/pkgs"

# Tell Circle to store the documentation output in a folder that we can access later
- store_artifacts:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- id: flake8

- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.2
rev: v1.9.3
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
Expand Down
5 changes: 1 addition & 4 deletions ci/environment-dev-3.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ dependencies:
- bottleneck
- codecov
- dask
- distributed
- esmpy
- git
- ipykernel
- matplotlib
- netcdf4
- numpy
- pip
Expand All @@ -20,6 +16,7 @@ dependencies:
- xarray>=0.12
- xesmf
- pre_commit
- cftime==1.0.3.4
- pip:
- pytest-lazy-fixture
- pytest-xdist
Expand Down
27 changes: 27 additions & 0 deletions ci/environment-dev-3.7-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: esmlab-dev
channels:
- conda-forge
dependencies:
- bottleneck
- codecov
- dask
- esmpy
- ipykernel
- make
- netcdf4
- numpy
- pandoc==1.19
- pip
- pytest
- pytest-cov
- python=3.7
- scipy
- xesmf
- cftime==1.0.3.4
- pip:
- pytest-lazy-fixture
- pytest-xdist
- xskillscore
- docrep
- git+https://github.com/pydata/xarray.git
- git+https://github.com/NCAR/esmlab-regrid.git
3 changes: 1 addition & 2 deletions ci/environment-dev-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ dependencies:
- bottleneck
- codecov
- dask
- distributed
- esmpy
- flake8
- git
- ipykernel
- isort
- make
Expand All @@ -27,6 +25,7 @@ dependencies:
- xarray>=0.12
- xesmf
- pre_commit
- cftime==1.0.3.4
- pip:
- nbsphinx
- numpydoc
Expand Down
27 changes: 27 additions & 0 deletions ci/environment-dev-3.8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: esmlab-dev
channels:
- conda-forge
dependencies:
- bottleneck
- codecov
- dask
- esmpy
- ipykernel
- make
- netcdf4
- numpy
- pandoc==1.19
- pip
- pytest
- pytest-cov
- python=3.8
- scipy
- xesmf
- cftime==1.0.3.4
- xarray
- pip:
- pytest-lazy-fixture
- pytest-xdist
- xskillscore
- docrep
- git+https://github.com/NCAR/esmlab-regrid.git
1 change: 0 additions & 1 deletion ci/install-circle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ conda config --add channels conda-forge
conda env create -f ci/environment-dev-${PYTHON}.yml --name=${ENV_NAME} --quiet
conda env list
source activate ${ENV_NAME}
pip install pip --upgrade
pip install --no-deps --quiet -e .
conda list -n ${ENV_NAME}
2 changes: 1 addition & 1 deletion ci/run-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e
set -eo pipefail

source activate ${ENV_NAME}
pytest -n 2 --junitxml=test-reports/junit.xml --cov=./ --verbose
pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
echo "[Upload coverage]"
codecov
12 changes: 7 additions & 5 deletions ci/docs.yml → docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ name: esmlab-dev
channels:
- conda-forge
dependencies:
- jupyterlab
- ipython
- nbsphinx
- numpydoc
- numpydoc=0.8.0
- dask
- pip
- python=3.7
- recommonmark
- sphinx_rtd_theme
- sphinx>=1.6
- sphinx_rtd_theme=0.4.2
- sphinx=1.8.2
- sphinx-copybutton=0.2.5
- esmpy
- bottleneck
- scipy
- make
- pip:
- sphinx_copybutton
- git+https://github.com/NCAR/esmlab-regrid.git
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
bottleneck
cftime
dask
esmpy
netcdf4
pyyaml
scipy
xarray>=0.11.2
Expand Down

0 comments on commit 35ce76b

Please sign in to comment.