-
Notifications
You must be signed in to change notification settings - Fork 18
590 lines (563 loc) · 21.2 KB
/
build_test.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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
name: build_test
on:
pull_request:
types: [ opened, synchronize ]
jobs:
check-rust:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
cache: true
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-check-rust
path: |
~/.cargo
target
.pixi
- name: Check fmt
run: pixi run check-rs-fmt
- name: Check warnings
run: pixi run check-rs-warnings
- name: Check clippy
run: pixi run check-rs-clippy
test-rust:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- windows-2022
- macos-14
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-test-rust2
path: |
~/.cargo
target
.pixi
- name: start minio server in the background
run: pixi run start-minio &
- name: Test rust
run: |
pixi run test-rs --release
- name: Upload test artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
if: always()
with:
name: vegafusion-rt-test-images
path: |
vegafusion-runtime/tests/output
build-vegafusion-wasm:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-wasm
path: |
~/.cargo
target
.pixi
- name: Build package
run: |
pixi run pack-wasm
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: vegafusion-wasm-packages
path: vegafusion-wasm/pkg/vegafusion-wasm-*.tgz
check-vegafusion-python:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-wasm
path: |
~/.cargo
target
.pixi
- name: Dev python
run: |
pixi run dev-py
- name: Check format and lint
run: |
pixi run lint-check-py
- name: Type check
run: |
pixi run type-check-py
# Use maturin action to build linux wheels within proper manylinux compatible containers
# (This is why we don't use the pixi "build-py" action)
build-vegafusion-python-linux-64:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Install latest stable Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # pin@v1
with:
toolchain: stable
override: true
- name: Cache rust dependencies
uses: Swatinem/rust-cache@81d053bdb0871dcd3f10763c8cc60d0adc41762b # pin@v1
with:
cache-on-failure: True
- name: Clear target/wheels
run: rm -rf target/wheels
- name: Build wheels (Linux)
uses: messense/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # [email protected]
with:
command: build
manylinux: 2014
rust-toolchain: stable
args: --release -m vegafusion-python/Cargo.toml --features=protobuf-src --strip
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: python-wheels
path: |
target/wheels/*.tar.gz
target/wheels/*.whl
build-vegafusion-python-linux-arm64:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Install latest stable Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # pin@v1
with:
toolchain: stable
override: true
- name: Cache rust dependencies
uses: Swatinem/rust-cache@81d053bdb0871dcd3f10763c8cc60d0adc41762b # pin@v1
with:
cache-on-failure: True
- name: Download arm64 toolchain
run: |
rustup target add aarch64-unknown-linux-gnu
- name: Clear target/wheels
run: rm -rf target/wheels
- name: Build arm64 wheels
uses: messense/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # [email protected]
with:
command: build
manylinux: 2_28
rust-toolchain: stable
args: --release -m vegafusion-python/Cargo.toml --features=protobuf-src --strip --target aarch64-unknown-linux-gnu
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: python-wheels
path: |
target/wheels/*.tar.gz
target/wheels/*.whl
build-vegafusion-python-win-64:
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
with:
python-version: '3.11'
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-python-win-64
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-python
run: |
pixi run build-py
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: python-wheels
path: |
target/wheels/*.tar.gz
target/wheels/*.whl
build-vegafusion-python-osx-64:
runs-on: macos-12
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-python-osx-64
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-python
run: |
pixi run build-py
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: python-wheels
path: |
target/wheels/*.tar.gz
target/wheels/*.whl
build-vegafusion-python-osx-arm64:
runs-on: macos-14
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: osx-arm64-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-python-osx-arm64
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-python
run: |
pixi run build-py --target aarch64-apple-darwin
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: python-wheels
path: |
target/wheels/*.tar.gz
target/wheels/*.whl
test-vegafusion-python-linux-64:
runs-on: ubuntu-20.04
needs: [build-vegafusion-python-linux-64]
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
with:
python-version: '3.11'
- name: Install Chrome
uses: browser-actions/setup-chrome@f0ff752add8c926994566c80b3ceadfd03f24d12 # pin@latest
with:
chrome-version: stable
- name: Install fonts on Linux
if: runner.os == 'Linux'
run: |
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer
- name: Download vegafusion-python wheel
uses: actions/download-artifact@cbed621e49e4c01b044d60f6c80ea4ed6328b281 # pin@v2
with:
name: python-wheels
path: target/wheels/
- name: install wheels
working-directory: target/wheels/
run: |
ls -la
python -m pip install vegafusion-*manylinux_2_17_x86_64*.whl
# Optional dependencies
python -m pip install pyarrow pandas polars-lts-cpu "duckdb>=1.0" "vl-convert-python>=1.0.1rc1" scikit-image "pandas>=2.2" jupytext voila anywidget ipywidgets chromedriver-binary-auto
# Test dependencies
python -m pip install pytest altair vega-datasets scikit-image jupytext voila ipykernel anywidget ipywidgets selenium flaky tenacity chromedriver-binary-auto
- name: Test lazy imports
working-directory: vegafusion-python/
run: python checks/check_lazy_imports.py
- name: Test vegafusion
working-directory: vegafusion-python/
env:
VEGAFUSION_TEST_HEADLESS: 1
run: pytest
- name: Upload test artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
if: always()
with:
name: vegafusion-python-test-failures
path: |
vegafusion-python/tests/output/*
test-vegafusion-python-osx-arm64:
runs-on: macos-14
needs: [build-vegafusion-python-osx-arm64]
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
with:
python-version: '3.10'
- name: Download vegafusion-python wheel
uses: actions/download-artifact@cbed621e49e4c01b044d60f6c80ea4ed6328b281 # pin@v2
with:
name: python-wheels
path: target/wheels/
- name: install wheels
working-directory: target/wheels/
run: |
ls -la
python -m pip install vegafusion-*macosx_11_*_arm64.whl
# Optional dependencies
python -m pip install pyarrow pandas polars "duckdb>=1.0" vl-convert-python "pandas>=2.2"
# Test dependencies
python -m pip install pytest altair vega-datasets scikit-image
- name: Test vegafusion
working-directory: vegafusion-python/
run: pytest --ignore=tests/test_jupyter_widget.py
test-vegafusion-python-win-64:
runs-on: windows-2022
needs: [build-vegafusion-python-win-64]
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
with:
python-version: '3.9'
- name: Install Chrome
uses: browser-actions/setup-chrome@f0ff752add8c926994566c80b3ceadfd03f24d12 # pin@latest
with:
chrome-version: stable
- name: Download vegafusion-python wheel
uses: actions/download-artifact@cbed621e49e4c01b044d60f6c80ea4ed6328b281 # pin@v2
with:
name: python-wheels
path: target/wheels/
- name: install wheels
working-directory: target/wheels/
shell: powershell
run: |
Get-ChildItem -Force
$vegafusion = Get-ChildItem -Name "vegafusion-*win_amd64.whl" | Select-Object -First 1
python -m pip install $vegafusion
# Optional dependencies
python -m pip install pyarrow pandas "numpy<2" polars[timezone] "duckdb>=1.0" vl-convert-python
# Test dependencies
python -m pip install pytest altair vega-datasets scikit-image
- name: Test vegafusion
working-directory: vegafusion-python/
run: pytest --ignore=tests/test_jupyter_widget.py
build-vegafusion-server-linux-64:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-server-linux-64
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-server
run: |
pixi run build-rs-server
- name: zip executable
uses: vimtor/action-zip@26a249fb00d43ca98dad77a4b3838025fc226aa1 # [email protected]
with:
files: target/release/vegafusion-server
dest: vegafusion-server-linux-64.zip
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: vegafusion-server
path: |
vegafusion-server-*
# # Below is an Attempt to cross compile to linux aarch64 within conda environment.
# # It fails in compiling protobuf-src. So instead we fall back to the direct use of
# # cargo (without involving conda).
#
# build-vegafusion-server-linux-arm64:
# runs-on: ubuntu-20.04
# steps:
# - name: Check out repository code
# uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
# - name: Install pixi
# run: curl -fsSL https://pixi.sh/install.sh | bash && echo "${HOME}/.pixi/bin" >> $GITHUB_PATH
# - name: Cache
# uses: actions/cache@v3
# with:
# key: linux-arm64-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-server
# path: |
# ~/.cargo
# target
# .pixi
# - name: Build vegafusion-server
# run: |
# pixi run python automation/download_rust_target.py aarch64-unknown-linux-gnu
# pixi add gcc_linux-aarch64 -p linux-64
# export RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc"
# pixi run build-rs-server --features=protobuf-src --target aarch64-unknown-linux-gnu
# - name: zip executable
# uses: vimtor/action-zip@26a249fb00d43ca98dad77a4b3838025fc226aa1 # [email protected]
# with:
# files: target/aarch64-unknown-linux-gnu/release/vegafusion-server
# dest: vegafusion-server-linux-arm64.zip
# - name: Upload artifacts
# uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
# with:
# name: vegafusion-server
# path: |
# vegafusion-server-*
build-vegafusion-server-linux-arm64:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- name: Install latest stable Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # pin@v1
with:
toolchain: stable
override: true
- name: Cache rust dependencies
uses: Swatinem/rust-cache@81d053bdb0871dcd3f10763c8cc60d0adc41762b # pin@v1
with:
cache-on-failure: True
- name: Download arm64 toolchain
run: |
rustup target add aarch64-unknown-linux-gnu
- name: Download gcc for cross compilation
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
- name: Build vegafusion-server
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # pin@v1
env:
RUSTFLAGS: "-C linker=aarch64-linux-gnu-gcc"
with:
command: build
args: -p vegafusion-server --release --features=protobuf-src --target=aarch64-unknown-linux-gnu
- name: zip executable
uses: vimtor/action-zip@26a249fb00d43ca98dad77a4b3838025fc226aa1 # [email protected]
with:
files: target/aarch64-unknown-linux-gnu/release/vegafusion-server
dest: vegafusion-server-linux-arm64.zip
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: vegafusion-server
path: |
vegafusion-server-*
build-vegafusion-server-win-64:
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-server-win-64b
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-server
run: |
pixi install -vvv
pixi run build-rs-server
- name: zip executable
uses: vimtor/action-zip@26a249fb00d43ca98dad77a4b3838025fc226aa1 # [email protected]
with:
files: target/release/vegafusion-server.exe
dest: vegafusion-server-win-64.zip
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: vegafusion-server
path: |
vegafusion-server-*
build-vegafusion-server-osx-64:
runs-on: macos-13
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-server-osx-64
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-server
run: |
pixi run build-rs-server
- name: zip executable
uses: vimtor/action-zip@26a249fb00d43ca98dad77a4b3838025fc226aa1 # [email protected]
with:
files: target/release/vegafusion-server
dest: vegafusion-server-osx-64.zip
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: vegafusion-server
path: |
vegafusion-server-*
build-vegafusion-server-osx-arm64:
runs-on: macos-14
steps:
- name: Check out repository code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.30.0
- name: Cache
uses: actions/cache@v3
with:
key: osx-arm64-${{ hashFiles('pixi.lock', 'Cargo.lock', 'vegafusion-python/pyproject.toml') }}-build-vegafusion-server-osx-arm64
path: |
~/.cargo
target
.pixi
- name: Build vegafusion-server
run: |
pixi run build-rs-server --target aarch64-apple-darwin
- name: zip executable
uses: vimtor/action-zip@26a249fb00d43ca98dad77a4b3838025fc226aa1 # [email protected]
with:
files: target/aarch64-apple-darwin/release/vegafusion-server
dest: vegafusion-server-osx-arm64.zip
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # [email protected]
with:
name: vegafusion-server
path: |
vegafusion-server-*