forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 0
323 lines (257 loc) · 8.14 KB
/
bokeh-ci.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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
name: Bokeh-CI
on:
push:
branches:
- main
- branch-*
pull_request:
defaults:
run:
shell: bash -l {0}
env:
CHROME_VER: "118.0.5993.88"
CHROME_REV: "chromium_2670"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history to get proper build version
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: 'latest'
activate-environment: bk-test
run-post: ${{ runner.os != 'Windows' }}
- name: Install libmamba solver
shell: bash -l {0}
run: |
conda install -q -n base conda-libmamba-solver
conda config --set solver libmamba
- name: Update bk-test environment
shell: bash -l {0}
run: |
conda env update -q -n bk-test -f conda/environment-build.yml
- name: Install node modules
run: bash scripts/ci/install_node_modules.sh
- name: Build BokehJS
working-directory: ./bokehjs
run: node make build
- name: Build pip packages
env:
BOKEHJS_ACTION: 'install'
run: python -m build .
- name: Verify pip install from sdist
run: bash scripts/ci/verify_pip_install_from_sdist.sh
- name: Verify pip install using sdist
run: bash scripts/ci/verify_pip_install_using_sdist.sh
- name: Verify pip install using wheel
run: bash scripts/ci/verify_pip_install_using_wheel.sh
- name: Build conda package
run: bash scripts/ci/build_conda_package.sh
- name: Verify conda install
run: bash scripts/ci/verify_conda_install.sh
- name: Upload wheel package
uses: actions/upload-artifact@v4
with:
name: wheel-package
path: dist/bokeh-*-py3-none-any.whl
- name: Upload bokehjs package
uses: actions/upload-artifact@v4
with:
name: bokehjs-package
path: bokehjs/build/dist/bokeh-bokehjs-*.tgz
codebase:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Configure line endings in git
if: runner.os == 'Windows'
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/workflows/composite/test-setup
with:
test-env: '3.10'
source-tree: 'keep'
- name: List installed software
run: |
conda info
conda list
echo "node $(node --version)"
echo "npm $(npm --version)"
- name: Run codebase checks
run: pytest --color=yes tests/codebase
- name: MyPy
if: success() || failure()
run: mypy --version && mypy
examples:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/workflows/composite/test-setup
with:
test-env: '3.10'
source-tree: 'delete'
- name: Install chromium
run: |
INSTALLED=$(chromium --version | cut -d' ' -f2 | cut -d'.' -f1-3)
EXPECTED=$(echo "$CHROME_VER" | cut -d'.' -f1-3)
echo "Currently installed Chromium $INSTALLED; expected $EXPECTED"
if [[ "$INSTALLED" = "$EXPECTED" ]]; then
echo "Using pre-installed version of chromium"
else
URL=https://github.com/bokeh/chromium/raw/main/linux/$CHROME_VER
wget --no-verbose $URL/$CHROME_REV.assert
wget --no-verbose $URL/$CHROME_REV.snap
sudo snap ack $CHROME_REV.assert
sudo snap install $CHROME_REV.snap
fi
- name: List installed software
run: |
conda info
conda list
echo "node $(node --version)"
echo "npm $(npm --version)"
chromium --version
- name: Start chrome headless
working-directory: ./bokehjs
run: node make test:spawn:headless # starts chrome in the background on port 9222
- name: Run tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: pytest -s -v --color=yes --tb line tests/test_examples.py
- name: Collect results
if: always()
env:
DST: "examples-report"
run: |
mkdir -p ${DST}
cp --parents examples-report.html $(cat .images-list) ${DST}
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: examples-report
path: examples-report
unit-test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 6
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/workflows/composite/test-setup
with:
test-env: ${{ matrix.python-version }}
source-tree: 'delete'
- name: Ensure Python version
run: if [[ ! "$(python --version | cut -d' ' -f2)" == "${{ matrix.python-version }}"* ]]; then exit 1; fi
- name: List installed software
run: |
conda info
conda list
echo "node $(node --version)"
echo "npm $(npm --version)"
- name: Test defaults
run: pytest tests/test_defaults.py
- name: Test cross
run: pytest tests/test_cross.py
- name: Run tests
if: success() || failure()
run: pytest --cov=bokeh --cov-report=xml --color=yes tests/unit
- name: Upload code coverage
uses: codecov/codecov-action@v4
if: success() || failure()
with:
env_vars: OS,PYTHON
flags: unit
verbose: true
minimal-deps:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
env:
OS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/workflows/composite/test-setup
with:
test-env: 'minimal-deps'
source-tree: 'delete'
- name: List installed software
run: |
conda info
conda list
echo "node $(node --version)"
echo "npm $(npm --version)"
- name: Run tests
run: pytest -m "not sampledata" --cov=bokeh --cov-report=xml --color=yes tests/unit
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
env_vars: OS
flags: unit,minimal
verbose: true
documentation:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/workflows/composite/test-setup
with:
test-env: '3.10'
source-tree: 'delete'
- name: List installed software
run: |
conda info
conda list
echo "node $(node --version)"
echo "npm $(npm --version)"
- name: Build docs
run: bash scripts/ci/build_docs.sh
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/bokeh/docs-html.tgz
downstream:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/workflows/composite/test-setup
with:
test-env: 'downstream'
source-tree: 'delete'
- name: Install downstream packages
run: bash scripts/ci/install_downstream_packages.sh
- name: List installed software
run: |
conda info
conda list
echo "node $(node --version)"
echo "npm $(npm --version)"
- name: Run tests
run: bash scripts/ci/run_downstream_tests.sh