-
Notifications
You must be signed in to change notification settings - Fork 59
725 lines (617 loc) · 20.8 KB
/
build.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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
name: Build
on:
pull_request:
push:
branches:
- 'master'
tags:
- '*'
jobs:
build:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
label:
# Bare Metal
- Bare Metal Nvidia PTX 64
# FIXME: fontdb currently can't handle this target.
# The `alloc::sync` module does not exist.
# - Bare Metal ARM Cortex-M thumbv6m
- Bare Metal ARM Cortex-M thumbv7em
- Bare Metal ARM Cortex-M thumbv7em Hardware Float
- Bare Metal ARM Cortex-M thumbv7m
- Bare Metal ARM Cortex-M thumbv8m.base
- Bare Metal ARM Cortex-M thumbv8m.main
- Bare Metal ARM Cortex-M thumbv8m.main Hardware Float
# FIXME: RISC-V without atomics doesn't work with ahash
# - Bare Metal RISC-V 32 i
# - Bare Metal RISC-V 32 imc
- Bare Metal RISC-V 32 imac
- Bare Metal RISC-V 64 gc
- Bare Metal RISC-V 64 imac
# WebAssembly
- WebAssembly Unknown
- WebAssembly Web
- WebAssembly WASI
# Windows
- Windows aarch64
# FIXME: The `windows` crate doesn't compile on this target.
# - Windows i586
- Windows i686
- Windows x86_64
- Windows i686 gnu
- Windows x86_64 gnu
# Linux
- Linux i586
- Linux i586 musl
- Linux i686
- Linux i686 musl
- Linux x86_64
- Linux x86_64 musl
# FIXME: We can't link anything without cross.
# - Linux x86_64 gnux32
- Linux arm
- Linux arm musl
- Linux arm Hardware Float
- Linux arm musl Hardware Float
- Linux armv5te
- Linux armv5te musl
- Linux armv7
- Linux armv7 musl
- Linux armv7 Hardware Float
- Linux armv7 musl Hardware Float
- Linux thumbv7neon
- Linux aarch64
- Linux aarch64 musl
- Linux powerpc
- Linux powerpc64
- Linux powerpc64le
- Linux riscv64gc
- Linux s390x
- Linux sparc64
# macOS
- macOS aarch64
- macOS x86_64
# iOS
- iOS aarch64
- iOS x86_64
# Android
- Android i686
- Android x86_64
- Android arm
- Android armv7
- Android thumbv7neon
- Android aarch64
# Other Unixes
- FreeBSD i686
- FreeBSD x86_64
- illumos x86_64
# FIXME: The target currently fails to link due to
# "ld: cannot find -lexecinfo"
# - NetBSD x86_64
- Solaris sparcv9
# - Solaris x86_64
# Testing other channels
- Windows Beta
- Windows Nightly
- Windows Beta gnu
- Windows Nightly gnu
- Linux Beta
- Linux Nightly
- macOS Beta
- macOS Nightly
include:
# Bare Metal
- label: Bare Metal Nvidia PTX 64
target: nvptx64-nvidia-cuda
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
# FIXME: fontdb currently can't handle this target.
# The `alloc::sync` module does not exist.
# - label: Bare Metal ARM Cortex-M thumbv6m
# target: thumbv6m-none-eabi
# tests: skip
# dylib: skip
# release: skip
# no_std: true
# install_target: true
- label: Bare Metal ARM Cortex-M thumbv7em
target: thumbv7em-none-eabi
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal ARM Cortex-M thumbv7em Hardware Float
target: thumbv7em-none-eabihf
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal ARM Cortex-M thumbv7m
target: thumbv7m-none-eabi
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal ARM Cortex-M thumbv8m.base
target: thumbv8m.base-none-eabi
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal ARM Cortex-M thumbv8m.main
target: thumbv8m.main-none-eabi
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal ARM Cortex-M thumbv8m.main Hardware Float
target: thumbv8m.main-none-eabihf
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
# - label: Bare Metal RISC-V 32 i
# target: riscv32i-unknown-none-elf
# tests: skip
# dylib: skip
# release: skip
# no_std: true
# install_target: true
# - label: Bare Metal RISC-V 32 imc
# target: riscv32imc-unknown-none-elf
# tests: skip
# dylib: skip
# release: skip
# no_std: true
# install_target: true
- label: Bare Metal RISC-V 32 imac
target: riscv32imac-unknown-none-elf
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal RISC-V 64 gc
target: riscv64gc-unknown-none-elf
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
- label: Bare Metal RISC-V 64 imac
target: riscv64imac-unknown-none-elf
tests: skip
dylib: skip
release: skip
no_std: true
install_target: true
# WebAssembly
- label: WebAssembly Unknown
target: wasm32-unknown-unknown
cross: skip
tests: skip
dylib: skip
release: skip
install_target: true
- label: WebAssembly Web
target: wasm32-unknown-unknown
cross: skip
tests: skip
dylib: skip
install_target: true
features: "--features wasm-web"
- label: WebAssembly WASI
target: wasm32-wasi
auto_splitting: skip
cross: skip
dylib: skip
install_target: true
# Windows
- label: Windows aarch64
target: aarch64-pc-windows-msvc
os: windows-latest
cross: skip
tests: skip
install_target: true
# - label: Windows i586
# target: i586-pc-windows-msvc
# os: windows-latest
# cross: skip
# auto_splitting: skip
# install_target: true
- label: Windows i686
target: i686-pc-windows-msvc
os: windows-latest
cross: skip
auto_splitting: skip
install_target: true
- label: Windows x86_64
target: x86_64-pc-windows-msvc
os: windows-latest
cross: skip
- label: Windows i686 gnu
target: i686-pc-windows-gnu
toolchain: stable-i686-pc-windows-gnu
os: windows-latest
cross: skip
auto_splitting: skip
install_target: true
- label: Windows x86_64 gnu
target: x86_64-pc-windows-gnu
toolchain: stable-x86_64-pc-windows-gnu
os: windows-latest
cross: skip
install_target: true
# Linux
- label: Linux i586
target: i586-unknown-linux-gnu
auto_splitting: skip
# FIXME: rustls currently does not support i586.
networking: skip
- label: Linux i586 musl
target: i586-unknown-linux-musl
auto_splitting: skip
dylib: skip
# FIXME: rustls currently does not support i586.
networking: skip
- label: Linux i686
target: i686-unknown-linux-gnu
auto_splitting: skip
- label: Linux i686 musl
target: i686-unknown-linux-musl
auto_splitting: skip
dylib: skip
- label: Linux x86_64
target: x86_64-unknown-linux-gnu
- label: Linux x86_64 musl
target: x86_64-unknown-linux-musl
dylib: skip
# FIXME: We can't link anything without cross.
# - label: Linux x86_64 gnux32
# target: x86_64-unknown-linux-gnux32
# cross: skip
# install_target: true
# dylib: skip
- label: Linux arm
target: arm-unknown-linux-gnueabi
auto_splitting: skip
- label: Linux arm musl
target: arm-unknown-linux-musleabi
auto_splitting: skip
dylib: skip
- label: Linux arm Hardware Float
target: arm-unknown-linux-gnueabihf
auto_splitting: skip
dylib: skip
- label: Linux arm musl Hardware Float
target: arm-unknown-linux-musleabihf
auto_splitting: skip
dylib: skip
- label: Linux armv5te
target: armv5te-unknown-linux-gnueabi
auto_splitting: skip
dylib: skip
- label: Linux armv5te musl
target: armv5te-unknown-linux-musleabi
auto_splitting: skip
dylib: skip
- label: Linux armv7
target: armv7-unknown-linux-gnueabi
auto_splitting: skip
- label: Linux armv7 musl
target: armv7-unknown-linux-musleabi
auto_splitting: skip
dylib: skip
- label: Linux armv7 Hardware Float
target: armv7-unknown-linux-gnueabihf
auto_splitting: skip
- label: Linux armv7 musl Hardware Float
target: armv7-unknown-linux-musleabihf
auto_splitting: skip
dylib: skip
- label: Linux thumbv7neon
target: thumbv7neon-unknown-linux-gnueabihf
auto_splitting: skip
- label: Linux aarch64
target: aarch64-unknown-linux-gnu
- label: Linux aarch64 musl
target: aarch64-unknown-linux-musl
dylib: skip
- label: Linux powerpc
target: powerpc-unknown-linux-gnu
auto_splitting: skip
- label: Linux powerpc64
target: powerpc64-unknown-linux-gnu
auto_splitting: skip
- label: Linux powerpc64le
target: powerpc64le-unknown-linux-gnu
auto_splitting: skip
- label: Linux riscv64gc
target: riscv64gc-unknown-linux-gnu
- label: Linux s390x
target: s390x-unknown-linux-gnu
software_rendering: skip
# FIXME: Somehow the rendering is messed up on s390x. I didn't look
# into what the problem is. Might be inaccurate floating point on
# this architecture.
- label: Linux sparc64
target: sparc64-unknown-linux-gnu
auto_splitting: skip
# FIXME: rustls currently does not support sparc64.
networking: skip
# macOS
- label: macOS aarch64
target: aarch64-apple-darwin
os: macos-latest
cross: skip
- label: macOS x86_64
target: x86_64-apple-darwin
os: macos-latest
cross: skip
install_target: true
# iOS
- label: iOS aarch64
target: aarch64-apple-ios
os: macOS-latest
cross: skip
dylib: skip
tests: skip
install_target: true
- label: iOS x86_64
target: x86_64-apple-ios
os: macOS-latest
cross: skip
dylib: skip
tests: skip
install_target: true
# Android
- label: Android i686
target: i686-linux-android
auto_splitting: skip
- label: Android x86_64
target: x86_64-linux-android
auto_splitting: skip
- label: Android arm
target: arm-linux-androideabi
auto_splitting: skip
- label: Android armv7
target: armv7-linux-androideabi
auto_splitting: skip
- label: Android thumbv7neon
target: thumbv7neon-linux-androideabi
auto_splitting: skip
- label: Android aarch64
target: aarch64-linux-android
auto_splitting: skip
# Other Unixes
- label: FreeBSD i686
target: i686-unknown-freebsd
tests: skip
- label: FreeBSD x86_64
target: x86_64-unknown-freebsd
tests: skip
- label: illumos x86_64
target: x86_64-unknown-illumos
tests: skip
# FIXME: The target currently fails to link due to
# "ld: cannot find -lexecinfo"
# - label: NetBSD x86_64
# target: x86_64-unknown-netbsd
# tests: skip
- label: Solaris sparcv9
target: sparcv9-sun-solaris
tests: skip
# FIXME: The target got renamed and cross doesn't support it yet.
# - label: Solaris x86_64
# target: x86_64-pc-solaris
# tests: skip
# Testing other channels
- label: Windows Beta
target: x86_64-pc-windows-msvc
os: windows-latest
toolchain: beta
release: skip
cross: skip
- label: Windows Nightly
target: x86_64-pc-windows-msvc
os: windows-latest
toolchain: nightly
release: skip
cross: skip
- label: Windows Beta gnu
target: x86_64-pc-windows-gnu
toolchain: beta-x86_64-pc-windows-gnu
release: skip
os: windows-latest
cross: skip
install_target: true
- label: Windows Nightly gnu
target: x86_64-pc-windows-gnu
toolchain: nightly-x86_64-pc-windows-gnu
release: skip
os: windows-latest
cross: skip
install_target: true
- label: Linux Beta
target: x86_64-unknown-linux-gnu
toolchain: beta
release: skip
- label: Linux Nightly
target: x86_64-unknown-linux-gnu
toolchain: nightly
release: skip
- label: macOS Beta
target: aarch64-apple-darwin
os: macOS-latest
toolchain: beta
release: skip
cross: skip
- label: macOS Nightly
target: aarch64-apple-darwin
os: macOS-latest
toolchain: nightly
release: skip
cross: skip
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- name: Install Rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.toolchain || 'stable' }}
- name: Install Target
if: matrix.install_target != ''
run: rustup target add ${{ matrix.target }}
- name: Download cross
if: matrix.cross == '' && matrix.no_std == ''
uses: robinraju/[email protected]
with:
repository: "cross-rs/cross"
latest: true
fileName: "cross-x86_64-unknown-linux-gnu.tar.gz"
out-file-path: "/home/runner/.cargo/bin"
- name: Install cross
if: matrix.cross == '' && matrix.no_std == ''
run: |
cd ~/.cargo/bin
tar -xzf cross-x86_64-unknown-linux-gnu.tar.gz
- name: Build Static Library
run: sh .github/workflows/build_static.sh
env:
TARGET: ${{ matrix.target }}
SKIP_CROSS: ${{ matrix.cross }}
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
FEATURES: ${{ matrix.features }}
NO_STD: ${{ matrix.no_std }}
- name: Build Shared Library
if: matrix.dylib == ''
run: sh .github/workflows/build_shared.sh
env:
TARGET: ${{ matrix.target }}
SKIP_CROSS: ${{ matrix.cross }}
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
FEATURES: ${{ matrix.features }}
- name: Test
if: matrix.tests == ''
run: sh .github/workflows/test.sh
env:
TARGET: ${{ matrix.target }}
SKIP_CROSS: ${{ matrix.cross }}
SKIP_AUTO_SPLITTING: ${{ matrix.auto_splitting }}
SKIP_NETWORKING: ${{ matrix.networking }}
SKIP_SOFTWARE_RENDERING: ${{ matrix.software_rendering }}
- name: Upload screenshots
if: matrix.tests == '' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: Screenshots ${{ matrix.label }}
path: target/renders
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
shell: bash
run: .github/workflows/before_deploy.sh
env:
OS_NAME: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
- name: Release
if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
uses: softprops/action-gh-release@v1
with:
files: livesplit-core-*.*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
bind_gen:
name: Generate bindings
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- name: Install Rust
uses: hecrj/setup-rust-action@v2
- name: Generate bindings
run: |
cd capi/bind_gen
cargo run
cd ../..
clippy:
name: Check clippy lints
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- name: Install Rust
uses: hecrj/setup-rust-action@v2
with:
components: clippy
- name: Run Clippy
run: cargo clippy --all-features
format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- name: Install Rust
uses: hecrj/setup-rust-action@v2
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt -- --check || true
bench:
name: Run benchmarks
runs-on: ubuntu-latest
env:
CRITERION_TOKEN: ${{ secrets.CRITERION_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: hecrj/setup-rust-action@v2
- name: Run benchmarks
run: |
# run benchmarks and save baseline to "criterion.dev.temp"
cargo bench --all-features -- --verbose --noplot --save-baseline criterion.dev.temp
# # set the path to the file to upload to criterion.dev
# echo "CRITERION_FILE_PATH=$(find ./target/criterion/ -name raw.csv)" >> $GITHUB_ENV
# - name: Upload benchmarks
# run: |
# # upload the file
# curl -F 'raw.csv=@${{ env.CRITERION_FILE_PATH }}' \
# 'https://api.criterion.dev/v1/${{ github.repository }}/measurements?token=${{ secrets.CRITERION_TOKEN }}&commit=${{ github.sha }}'
docs:
name: Generate documentation
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node 10
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Build TypeScript documentation
run: |
cd capi/js
make docs
cd ../..
- name: Upload documentation files
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git clone -q "https://github.com/LiveSplit/livesplit-core-docs"
cd livesplit-core-docs
rm -r *
mv ../docs/* .
git add .
git commit --amend -m "Update documentation"
git push --force https://action:${{ secrets.LIVESPLIT_CORE_DOCS_UPLOAD }}@github.com/LiveSplit/livesplit-core-docs.git