1
1
version : 2
2
+ # Tell CircleCI to use this workflow
3
+ workflows :
4
+ version : 2
5
+ default :
6
+ jobs :
7
+ - " python-3.6"
2
8
3
9
jobs :
4
-
5
- # Define a "build_test" job to be run with Circle
6
- build_test :
7
10
11
+ " python-3.6 " :
8
12
# This is the base environment that Circle will use
9
13
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
+
12
19
steps :
13
-
14
- - run : apk add --no-cache build-base ca-certificates git openssh bash curl
15
-
16
20
# Get our data and merge with upstream
17
21
- checkout
18
-
22
+
19
23
# Restore cached files to speed things up
20
24
- restore_cache :
21
- keys :
22
- - conda-pkgs
25
+ key : deps-{{ .Branch }}-3.6-{{ checksum "environment-dev.yml" }}
23
26
24
- - run : ./ci/install-circleci.sh
27
+ - run : # install and activate conda environment
28
+ name : configure conda
29
+ command : ./ci/install-circle.sh
25
30
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
+
26
56
# Cache some files for a speedup in subsequent builds
27
57
- save_cache :
28
- key : conda-pkgs
58
+ key : deps-{{ .Branch }}-3.6-{{ checksum "environment-dev.yml" }}
29
59
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"
36
62
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
41
72
42
73
43
-
44
- # Tell CircleCI to use this workflow
45
- workflows :
46
- version : 2
47
- default :
48
- jobs :
49
- - build_test
50
74
0 commit comments