/
.travis.yml
286 lines (229 loc) · 7.58 KB
/
.travis.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# We deliberately don't use travis's language=python option because
# we install miniconda and use conda to get python. Additionally,
# Travis's auto-install of python doesn't work on osx images (see
# https://github.com/travis-ci/travis-ci/issues/4729).
# This file should be using semantically named doit commands defined in
# dodo.py
language: generic
sudo: false
os:
- linux
env:
global:
- PYENV_VERSION=3.7
stages:
- name: test_changes
if: branch != master
- name: test
if: (commit_message =~ /^.*(test:).*$/) OR commit_message =~ /^.*(build:).*$/ OR (type = cron)
- name: build_project
if: commit_message =~ /^.*(build:).*$/
- name: website_dev
if: (commit_message =~ /^.*(build:).*$/) OR (branch = master)
- name: website_release
if: (commit_message =~ /^.*(build:).*$/) AND (commit_message =~ /^.*(website_release).*$/)
jobs:
include:
# This stage will run on every build and check for changes between the last commit
# and this one. Then it'll run tests on any projects that have changes in them.
# If you make changes in all the projects include [test:all] in your commit message
# and cancel this job.
- &test
stage: test_changes
env: DESC="Check all projects for changes and run needed tests"
before_install:
- pip install pyctdev && doit miniconda_install && pip uninstall -y pyctdev doit
- export PATH="$HOME/miniconda/bin:$PATH" && hash -r
- conda install -y -c pyviz pyctdev
- doit ecosystem_setup
script:
- |
if [ -z "$TRAVIS_COMMIT_RANGE" ]; then
git fetch https://github.com/$TRAVIS_REPO_SLUG.git master:refs/remotes/master
git diff $TRAVIS_COMMIT..master --name-only > .diff
else
git diff $TRAVIS_COMMIT_RANGE --name-only > .diff
fi
- |
for DIR in *; do
if [ -d "${DIR}" ]; then
echo "checking for changes in $DIR"
if doit changes_in_dir --name $DIR; then
doit small_data_setup --name $DIR
doit test_project --name $DIR
doit small_data_cleanup --name $DIR
doit project_in_travis --name $DIR
fi;
fi;
done
# Use [test:<example_dir>] in your commit message to only run a particular set of tests
- &test_project
<<: *test
stage: test
env: DIR=attractors
if: |
(commit_message =~ concat(^.*,env(DIR),.*$)) OR
(commit_message =~ /^.*(test:all).*$/) OR
(type = cron)
script:
- doit small_data_setup --name $DIR
- doit test_project --name $DIR
- doit small_data_cleanup --name $DIR
- <<: *test_project
env: DIR=bay_trimesh
- <<: *test_project
env: DIR=boids
- <<: *test_project
env: DIR=census
- <<: *test_project
env: DIR=datashader_dashboard
- <<: *test_project
env: DIR=euler
- <<: *test_project
env: DIR=gapminders
- <<: *test_project
env: DIR=gerrymandering
- <<: *test_project
env: DIR=glaciers
- <<: *test_project
env: DIR=gull_tracking
- <<: *test_project
env: DIR=heat_and_trees
- <<: *test_project
env: DIR=hipster_dynamics
- <<: *test_project
env: DIR=landsat
- <<: *test_project
env: DIR=lsystems
- <<: *test_project
env: DIR=ml_annotators
- <<: *test_project
env: DIR=network_packets
- <<: *test_project
env: DIR=nyc_taxi
- <<: *test_project
env: DIR=opensky
- <<: *test_project
env: DIR=osm
- <<: *test_project
env: DIR=portfolio_optimizer
- <<: *test_project
env: DIR=square_limit
- <<: *test_project
env: DIR=sri_model
- <<: *test_project
env: DIR=uk_researchers
- <<: *test_project
env: DIR=iex_trading
- <<: *test_project
env: DIR=voila_gpx_viewer
- &build_project
<<: *test_project
stage: build_project
env: DIR=attractors
if: |
(commit_message =~ concat(^.*,env(DIR),.*$)) OR
(commit_message =~ /^.*(build:all).*$/)
script:
- doit archive_project --name $DIR
- anaconda-project prepare --directory $DIR
- source activate $DIR/envs/default && pip install pyctdev
- conda install -y -c pyviz/label/dev "nbsite>=0.6.5" holoviews sphinx_pyviz_theme selenium phantomjs lxml nomkl
- doit build_project --name $DIR
after_success:
- git config user.email "travis@travis.org"
- git config user.name "travis"
- mv ./doc/$DIR ./tmp
- git fetch https://github.com/$TRAVIS_REPO_SLUG.git evaluated:refs/remotes/evaluated
- git checkout evaluated
- if [ -e ./doc/$DIR ]; then rm -rf ./doc/$DIR; fi
- mkdir ./doc/$DIR
- mv ./tmp/* ./doc/$DIR
- git add ./doc/$DIR
- git commit -m "adding $DIR"
- git push -f -q "https://pyviz-developers:$GITHUB_TOKEN@github.com/pyviz-topics/examples.git" HEAD:evaluated
- <<: *build_project
env: DIR=bay_trimesh
- <<: *build_project
env: DIR=boids
- <<: *build_project
env: DIR=census
- <<: *build_project
env: DIR=euler
- <<: *build_project
env: DIR=gapminders
- <<: *build_project
env: DIR=gerrymandering
- <<: *build_project
env: DIR=glaciers
- <<: *build_project
env: DIR=gull_tracking
- <<: *build_project
env: DIR=heat_and_trees
- <<: *build_project
env: DIR=hipster_dynamics
- <<: *build_project
env: DIR=landsat
- <<: *build_project
env: DIR=lsystems
- <<: *build_project
env: DIR=ml_annotators
- <<: *build_project
env: DIR=network_packets
- <<: *build_project
env: DIR=nyc_taxi
- <<: *build_project
env: DIR=opensky
- <<: *build_project
env: DIR=portfolio_optimizer
- <<: *build_project
env: DIR=square_limit
- <<: *build_project
env: DIR=sri_model
- <<: *build_project
env: DIR=uk_researchers
- <<: *build_project
env: DIR=iex_trading
- <<: *build_project
env: DIR=voila_gpx_viewer
- &local_project
stage: build_project
env: DIR=osm
if: |
(commit_message =~ concat(^.*,env(DIR),.*$)) OR
(commit_message =~ /^.*(build:all).*$/)
script: echo 'Need to build locally and check in to evaluated' && exit 1;
- <<: *local_project
env: DIR=datashader_dashboard
- &build_website
stage: website_release
install:
- pip install pyctdev && doit miniconda_install
- export PATH="$HOME/miniconda/bin:$PATH" && hash -r
- doit ecosystem_setup
- conda install -y -c pyviz/label/dev "nbsite>=0.6.5" sphinx_pyviz_theme lxml pyyaml holoviews nomkl
before_script:
- git checkout -b deploy-${TRAVIS_BRANCH}
- git fetch https://github.com/$TRAVIS_REPO_SLUG.git evaluated:refs/remotes/evaluated # all evaluated notebooks, json, and rst should be checked in to this branch
- git checkout evaluated -- ./doc
script: doit build_website
deploy:
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: ./builtdocs
fqdn: examples.pyviz.org
on:
all_branches: true
- <<: *build_website
stage: website_dev
deploy:
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: ./builtdocs
repo: pyviz-dev/examples
on:
all_branches: true
notifications:
email: false