Skip to content
This repository was archived by the owner on Mar 15, 2019. It is now read-only.

Commit 32cb72b

Browse files
committed
Update circleCI docker image
1 parent 8dba8da commit 32cb72b

File tree

3 files changed

+71
-30
lines changed

3 files changed

+71
-30
lines changed

.circleci/config.yml

+54-30
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,74 @@
11
version: 2
2+
# Tell CircleCI to use this workflow
3+
workflows:
4+
version: 2
5+
default:
6+
jobs:
7+
- "python-3.6"
28

39
jobs:
4-
5-
# Define a "build_test" job to be run with Circle
6-
build_test:
710

11+
"python-3.6":
812
# This is the base environment that Circle will use
913
docker:
10-
- image: frolvlad/alpine-miniconda3
11-
14+
- image: continuumio/miniconda:latest
15+
environment:
16+
PYTHON: "3.6"
17+
ENV_NAME: "intake-cmip-dev"
18+
1219
steps:
13-
14-
- run: apk add --no-cache build-base ca-certificates git openssh bash curl
15-
1620
# Get our data and merge with upstream
1721
- checkout
18-
22+
1923
# Restore cached files to speed things up
2024
- restore_cache:
21-
keys:
22-
- conda-pkgs
25+
key: deps-{{ .Branch }}-3.6-{{ checksum "environment-dev.yml" }}
2326

24-
- run: ./ci/install-circleci.sh
27+
- run: # install and activate conda environment
28+
name: configure conda
29+
command: ./ci/install-circle.sh
2530

31+
- run:
32+
command: |
33+
source activate ${ENV_NAME}
34+
pytest --junitxml=test-reports/junit.xml --cov=./
35+
36+
- run:
37+
name: Code Coverage + Code Styling with (black, flake8, isort)
38+
command: |
39+
source activate ${ENV_NAME}
40+
echo "[Upload coverage]"
41+
codecov
42+
echo "[flake8]"
43+
flake8
44+
echo "[black]"
45+
black --check .
46+
echo "[isort]"
47+
isort --recursive --check-only .
48+
- run:
49+
name: Check documentation build
50+
command: |
51+
source activate ${ENV_NAME}
52+
pushd docs
53+
make html
54+
popd
55+
2656
# Cache some files for a speedup in subsequent builds
2757
- save_cache:
28-
key: conda-pkgs
58+
key: deps-{{ .Branch }}-3.6-{{ checksum "environment-dev.yml" }}
2959
paths:
30-
- /opt/conda/pkgs
31-
32-
# Run tests
33-
- run:
34-
name: Running Tests
35-
command: source activate intake-cmip-dev && py.test --junitxml=test-reports/junit.xml --cov=./
60+
- "/opt/conda/envs/${ENV_NAME}/"
61+
- "/opt/conda/pkgs"
3662

37-
- run:
38-
name: Coverage
39-
command: source activate intake-cmip-dev && codecov
40-
when: on_success
63+
- store_test_results:
64+
path: test-reports
65+
66+
- store_artifacts:
67+
path: test-reports
68+
# Tell Circle to store the documentation output in a folder that we can access later
69+
- store_artifacts:
70+
path: docs/_build/html
71+
destination: html
4172

4273

43-
44-
# Tell CircleCI to use this workflow
45-
workflows:
46-
version: 2
47-
default:
48-
jobs:
49-
- build_test
5074

ci/install-circle.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -eo pipefail
5+
6+
apt-get update; apt-get install -y make
7+
conda config --set always_yes true --set changeps1 false --set quiet true
8+
conda update -q conda
9+
conda env create -f environment-dev.yml --name=${ENV_NAME} --quiet
10+
conda env list
11+
source activate ${ENV_NAME}
12+
pip install pip --upgrade
13+
pip install --no-deps --quiet -e .
14+
conda list -n ${ENV_NAME}

environment-dev.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ dependencies:
1313
- dask
1414
- distributed
1515
- autopep8
16+
- flake8
17+
- black
18+
- isort
1619
- pytest
1720
- coverage
1821
- pytest-cov

0 commit comments

Comments
 (0)