forked from bjodah/chempy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
124 lines (117 loc) · 4.76 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
pipeline:
restore-cache:
image: drillster/drone-volume-cache
restore: true
mount:
- ./ci-cache/pyusrb
- ./ci-cache/conda_packages
- ./ci-cache/pip_cache
volumes:
- /tmp/cache:/cache
ttl: 90 # liftetime in days
install:
image: bjodah/bjodahimg20dev:v1.2.3
environment:
- CC=gcc-10
- CXX=g++-10
- CPLUS_INCLUDE_PATH=/opt/boost_1_73_p/include
- SUNDBASE=/opt/sundials-5.3.0-klu-lapack
- CPATH=/usr/include/suitesparse # sunlinsol_klu.h includes "klu.h"
commands:
- export PYTHONUSERBASE=$(pwd)/ci-cache/pyusrb
- if [ ! -d $PYTHONUSERBASE ]; then mkdir -p $PYTHONUSERBASE; fi
- export CPATH=$SUNDBASE/include:$CPATH
- export LIBRARY_PATH=$SUNDBASE/lib
- export LD_LIBRARY_PATH=$SUNDBASE/lib
- python3 -m pip install --cache-dir ./ci-cache/pip_cache --user -e .[all]
- python3 -c "import pycvodes" # debug this CI config
- git fetch -tq
- python3 setup.py sdist # test pip installable sdist (checks MANIFEST.in)
- git archive -o dist/chempy-head.zip HEAD # test pip installable zip (symlinks break)
- mkdir -p deploy/public_html/branches/${DRONE_BRANCH}
- cp dist/chempy-* deploy/public_html/branches/${DRONE_BRANCH}/
test-suite:
image: bjodah/bjodahimg20dev:v1.2.3
group: testing
environment:
- CC=gcc-10
- CXX=g++-10
- CPLUS_INCLUDE_PATH=/opt/boost_1_73_p/include
- SUNDBASE=/opt/sundials-5.3.0-klu-lapack
- CPATH=/usr/include/suitesparse # sunlinsol_klu.h includes "klu.h"
commands:
- export PYTHONUSERBASE=$(pwd)/ci-cache/pyusrb
- export CPATH=$SUNDBASE/include:$CPATH
- export LIBRARY_PATH=$SUNDBASE/lib
- export LD_LIBRARY_PATH=$SUNDBASE/lib
- bash -c '[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]'
- ./scripts/run_tests.sh --cov chempy --cov-report html --slow --veryslow
- ./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg
- cp -r htmlcov/ deploy/public_html/branches/${DRONE_BRANCH}/
- ./.ci/grep-for-merge-blocking-token.sh
- export CHEMPY_DEPRECATION_FILTER=ignore
- python3 -m virtualenv /tmp/test_sdist
- python3 -m virtualenv /tmp/test_git_archive
- cd deploy/public_html/branches/${DRONE_BRANCH}
- bash -c "source /tmp/test_sdist/bin/activate; pip install --cache-dir ./ci-cache/pip_cache $(eval ls chempy-*.tar.gz) pytest; pytest --pyargs chempy"
- bash -c "source /tmp/test_git_archive/bin/activate; pip install --cache-dir ./ci-cache/pip_cache chempy-head.zip pytest; pytest --pyargs chempy"
render-notebooks:
image: bjodah/bjodahimg20dev:v1.2.3
group: testing
environment:
- CHEMPY_DEPRECATION_FILTER=ignore
- SUNDBASE=/opt/sundials-5.3.0-klu-lapack
- CC=gcc-10
- CXX=g++-10
commands:
- export PYTHONUSERBASE=$(pwd)/ci-cache/pyusrb
- export CPATH=$SUNDBASE/include
- export LIBRARY_PATH=$SUNDBASE/lib
- export LD_LIBRARY_PATH=$SUNDBASE/lib
- ./scripts/render_notebooks.sh
- ./.ci/grep-for-binary-data.sh
- mv index.html index.ipynb.html
# - (cd examples/; for f in bokeh_*.py; do python3 -m bokeh html $f; done)
- cp -r index.* examples/ "deploy/public_html/branches/${DRONE_BRANCH}"
# conda-recipe:
# image: bjodah/bjodahimg20dev:v1.2.3
# group: testing
# commands:
# - export CONDA_PKGS_DIRS=$(pwd)/ci-cache/conda_packages
# - git fetch -tq
# - PATH=/opt/miniconda3/bin:$PATH conda config --add channels bjodah # sym, pyodesys, pyneqsys
# - PATH=/opt/miniconda3/bin:$PATH conda build --output-folder "deploy/public_html/branches/${DRONE_BRANCH}" conda-recipe
# - (cd $CONDA_PKGS_DIRS; find . -maxdepth 1 -type d -not -path . -not -path .. | xargs rm -r)
compile-documentation:
image: bjodah/bjodahimg20dev:v1.2.3
environment:
- CHEMPY_DEPRECATION_FILTER=ignore
- SUNDBASE=/opt/sundials-5.3.0-klu-lapack
commands:
- export PYTHONUSERBASE=$(pwd)/ci-cache/pyusrb
- export CPATH=$SUNDBASE/include
- export LIBRARY_PATH=$SUNDBASE/lib
- export LD_LIBRARY_PATH=$SUNDBASE/lib
- ./scripts/generate_docs.sh
- cp LICENSE doc/_build/html/
- cp -r doc/_build/html/ deploy/public_html/branches/${DRONE_BRANCH}
rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
mount:
# - ./ci-cache/sund-3.2.1
- ./ci-cache/pyusrb
- ./ci-cache/conda_packages
- ./ci-cache/pip_cache
volumes:
- /tmp/cache:/cache
deploy:
image: drillster/drone-rsync
when:
event: [push]
hosts: [ "hera.physchem.kth.se" ]
port: 22
user: chempy
secrets: [ rsync_key ] # secret only set fro event "push" not "pull_request"
source: ./deploy/public_html
target: ~/