fork/livesplit-core

git clone https://git.julia.blue/fork/livesplit-core

dependabot[bot]Update wasmtime requirement from 0.39.1 to 0.40.0 (#554)ebde0dc

master
22.7 KiB777 linesraw
1name: Build
2
3on:
4  pull_request:
5  push:
6    branches:
7      - 'master'
8    tags:
9      - '*'
10
11env:
12  CARGO_TERM_COLOR: always
13
14jobs:
15  build:
16    runs-on: ${{ matrix.os }}
17    strategy:
18      fail-fast: false
19      matrix:
20        label:
21          # Bare Metal
22          - Bare Metal Nvidia PTX 64
23          - Bare Metal ARM Cortex-M thumbv6m
24          - Bare Metal ARM Cortex-M thumbv7em
25          - Bare Metal ARM Cortex-M thumbv7em Hardware Float
26          - Bare Metal ARM Cortex-M thumbv7m
27          - Bare Metal ARM Cortex-M thumbv8m.base
28          - Bare Metal ARM Cortex-M thumbv8m.main
29          - Bare Metal ARM Cortex-M thumbv8m.main Hardware Float
30          # FIXME: RISC-V without atomics doesn't work with ahash
31          # - Bare Metal RISC-V 32 i
32          # - Bare Metal RISC-V 32 imc
33          - Bare Metal RISC-V 32 imac
34          - Bare Metal RISC-V 64 gc
35          - Bare Metal RISC-V 64 imac
36
37          # WebAssembly
38          - WebAssembly Unknown
39          - WebAssembly Web
40          - WebAssembly WASI
41
42          # Windows
43          - Windows aarch64
44          # FIXME: The `windows` crate doesn't compile on this target.
45          # - Windows i586
46          - Windows i686
47          - Windows x86_64
48          - Windows i686 gnu
49          - Windows x86_64 gnu
50
51          # Linux
52          - Linux i586
53          - Linux i586 musl
54          - Linux i686
55          - Linux i686 musl
56          - Linux x86_64
57          - Linux x86_64 musl
58          - Linux x86_64 gnux32
59          - Linux arm
60          - Linux arm musl
61          - Linux arm Hardware Float
62          - Linux arm musl Hardware Float
63          - Linux armv5te
64          - Linux armv5te musl
65          - Linux armv7 Hardware Float
66          - Linux armv7 musl Hardware Float
67          - Linux aarch64
68          - Linux mips
69          - Linux mips64
70          - Linux mips64el
71          - Linux mipsel
72          - Linux mipsel musl
73          # Unstable
74          # - env: TARGET=mipsisa32r6-unknown-linux-gnu
75          # - env: TARGET=mipsisa32r6el-unknown-linux-gnu
76          # - env: TARGET=mipsisa64r6-unknown-linux-gnuabi64
77          # - env: TARGET=mipsisa64r6el-unknown-linux-gnuabi64
78          - Linux powerpc
79          - Linux powerpc64le
80          - Linux s390x
81          # These got removed from cross, because they kept breaking:
82          # https://github.com/rust-embedded/cross/pull/440
83          # - Linux powerpc64
84          # - Linux sparc64
85
86          # macOS
87          - macOS aarch64
88          - macOS x86_64
89
90          # iOS
91          - iOS aarch64
92          - iOS x86_64
93
94          # Android
95          - Android i686
96          - Android x86_64
97          - Android arm
98          - Android armv7
99          - Android aarch64
100
101          # *BSD
102          # - i686-unknown-freebsd DISABLE_TESTS=1
103          # - x86_64-unknown-freebsd DISABLE_TESTS=1
104          - NetBSD x86_64
105
106          # Solaris
107          # - Solaris x86_64
108          # weird error
109          # https://travis-ci.org/LiveSplit/livesplit-core/jobs/327011754
110          # - env: TARGET=sparcv9-sun-solaris
111
112          # Testing other channels
113          - Windows Beta
114          - Windows Nightly
115          - Windows Beta gnu
116          - Windows Nightly gnu
117          - Linux Beta
118          - Linux Nightly
119          - macOS Beta
120          - macOS Nightly
121
122        include:
123          # Bare Metal
124          - label: Bare Metal Nvidia PTX 64
125            target: nvptx64-nvidia-cuda
126            os: ubuntu-latest
127            toolchain: stable
128            tests: skip
129            dylib: skip
130            release: skip
131            no_std: true
132            install_target: true
133
134          - label: Bare Metal ARM Cortex-M thumbv6m
135            target: thumbv6m-none-eabi
136            os: ubuntu-latest
137            toolchain: stable
138            tests: skip
139            dylib: skip
140            release: skip
141            no_std: true
142            install_target: true
143
144          - label: Bare Metal ARM Cortex-M thumbv7em
145            target: thumbv7em-none-eabi
146            os: ubuntu-latest
147            toolchain: stable
148            tests: skip
149            dylib: skip
150            release: skip
151            no_std: true
152            install_target: true
153
154          - label: Bare Metal ARM Cortex-M thumbv7em Hardware Float
155            target: thumbv7em-none-eabihf
156            os: ubuntu-latest
157            toolchain: stable
158            tests: skip
159            dylib: skip
160            release: skip
161            no_std: true
162            install_target: true
163
164          - label: Bare Metal ARM Cortex-M thumbv7m
165            target: thumbv7m-none-eabi
166            os: ubuntu-latest
167            toolchain: stable
168            tests: skip
169            dylib: skip
170            release: skip
171            no_std: true
172            install_target: true
173
174          - label: Bare Metal ARM Cortex-M thumbv8m.base
175            target: thumbv8m.base-none-eabi
176            os: ubuntu-latest
177            toolchain: stable
178            tests: skip
179            dylib: skip
180            release: skip
181            no_std: true
182            install_target: true
183
184          - label: Bare Metal ARM Cortex-M thumbv8m.main
185            target: thumbv8m.main-none-eabi
186            os: ubuntu-latest
187            toolchain: stable
188            tests: skip
189            dylib: skip
190            release: skip
191            no_std: true
192            install_target: true
193
194          - label: Bare Metal ARM Cortex-M thumbv8m.main Hardware Float
195            target: thumbv8m.main-none-eabihf
196            os: ubuntu-latest
197            toolchain: stable
198            tests: skip
199            dylib: skip
200            release: skip
201            no_std: true
202            install_target: true
203
204          # - label: Bare Metal RISC-V 32 i
205          #   target: riscv32i-unknown-none-elf
206          #   os: ubuntu-latest
207          #   toolchain: stable
208          #   tests: skip
209          #   dylib: skip
210          #   release: skip
211          #   no_std: true
212          #   install_target: true
213
214          # - label: Bare Metal RISC-V 32 imc
215          #   target: riscv32imc-unknown-none-elf
216          #   os: ubuntu-latest
217          #   toolchain: stable
218          #   tests: skip
219          #   dylib: skip
220          #   release: skip
221          #   no_std: true
222          #   install_target: true
223
224          - label: Bare Metal RISC-V 32 imac
225            target: riscv32imac-unknown-none-elf
226            os: ubuntu-latest
227            toolchain: stable
228            tests: skip
229            dylib: skip
230            release: skip
231            no_std: true
232            install_target: true
233
234          - label: Bare Metal RISC-V 64 gc
235            target: riscv64gc-unknown-none-elf
236            os: ubuntu-latest
237            toolchain: stable
238            tests: skip
239            dylib: skip
240            release: skip
241            no_std: true
242            install_target: true
243
244          - label: Bare Metal RISC-V 64 imac
245            target: riscv64imac-unknown-none-elf
246            os: ubuntu-latest
247            toolchain: stable
248            tests: skip
249            dylib: skip
250            release: skip
251            no_std: true
252            install_target: true
253
254          # WebAssembly
255          - label: WebAssembly Unknown
256            target: wasm32-unknown-unknown
257            os: ubuntu-latest
258            cross: skip
259            tests: skip
260            dylib: skip
261            install_target: true
262
263          - label: WebAssembly Web
264            target: wasm32-unknown-unknown
265            os: ubuntu-latest
266            cross: skip
267            tests: skip
268            dylib: skip
269            install_target: true
270            features: "--features wasm-web"
271
272          - label: WebAssembly WASI
273            target: wasm32-wasi
274            os: ubuntu-latest
275            cross: skip
276            dylib: skip
277            install_target: true
278
279          # Windows
280          - label: Windows aarch64
281            target: aarch64-pc-windows-msvc
282            os: windows-latest
283            cross: skip
284            tests: skip
285            install_target: true
286
287          # - label: Windows i586
288          #   target: i586-pc-windows-msvc
289          #   os: windows-latest
290          #   cross: skip
291          #   auto_splitting: skip
292          #   install_target: true
293
294          - label: Windows i686
295            target: i686-pc-windows-msvc
296            os: windows-latest
297            cross: skip
298            auto_splitting: skip
299            install_target: true
300
301          - label: Windows x86_64
302            target: x86_64-pc-windows-msvc
303            os: windows-latest
304            cross: skip
305
306          - label: Windows i686 gnu
307            target: i686-pc-windows-gnu
308            toolchain: stable-i686-pc-windows-gnu
309            os: windows-latest
310            cross: skip
311            auto_splitting: skip
312            networking: skip
313            # Networking fails due to some linking error regarding -lntdll
314            install_target: true
315
316          - label: Windows x86_64 gnu
317            target: x86_64-pc-windows-gnu
318            toolchain: stable-x86_64-pc-windows-gnu
319            os: windows-latest
320            cross: skip
321            install_target: true
322
323          # Linux
324          - label: Linux i586
325            target: i586-unknown-linux-gnu
326            os: ubuntu-latest
327            auto_splitting: skip
328
329          - label: Linux i586 musl
330            target: i586-unknown-linux-musl
331            os: ubuntu-latest
332            tests: skip
333            dylib: skip
334
335          - label: Linux i686
336            target: i686-unknown-linux-gnu
337            os: ubuntu-latest
338            auto_splitting: skip
339
340          - label: Linux i686 musl
341            target: i686-unknown-linux-musl
342            os: ubuntu-latest
343            auto_splitting: skip
344            dylib: skip
345
346          - label: Linux x86_64
347            target: x86_64-unknown-linux-gnu
348            os: ubuntu-latest
349
350          - label: Linux x86_64 musl
351            target: x86_64-unknown-linux-musl
352            os: ubuntu-latest
353            dylib: skip
354
355          - label: Linux x86_64 gnux32
356            target: x86_64-unknown-linux-gnux32
357            os: ubuntu-latest
358            cross: skip
359            install_target: true
360            tests: skip
361            dylib: skip
362
363          - label: Linux arm
364            target: arm-unknown-linux-gnueabi
365            os: ubuntu-latest
366            tests: skip
367
368          - label: Linux arm musl
369            target: arm-unknown-linux-musleabi
370            os: ubuntu-latest
371            tests: skip
372            dylib: skip
373
374          - label: Linux arm Hardware Float
375            target: arm-unknown-linux-gnueabihf
376            os: ubuntu-latest
377            tests: skip
378            dylib: skip
379
380          - label: Linux arm musl Hardware Float
381            target: arm-unknown-linux-musleabihf
382            os: ubuntu-latest
383            tests: skip
384            dylib: skip
385
386          - label: Linux armv5te
387            target: armv5te-unknown-linux-gnueabi
388            os: ubuntu-latest
389            tests: skip
390            dylib: skip
391
392          - label: Linux armv5te musl
393            target: armv5te-unknown-linux-musleabi
394            os: ubuntu-latest
395            tests: skip
396            dylib: skip
397
398          - label: Linux armv7 Hardware Float
399            target: armv7-unknown-linux-gnueabihf
400            os: ubuntu-latest
401            auto_splitting: skip
402
403          - label: Linux armv7 musl Hardware Float
404            target: armv7-unknown-linux-musleabihf
405            os: ubuntu-latest
406            tests: skip
407            dylib: skip
408
409          - label: Linux aarch64
410            target: aarch64-unknown-linux-gnu
411            os: ubuntu-latest
412
413          - label: Linux mips
414            target: mips-unknown-linux-gnu
415            os: ubuntu-latest
416            auto_splitting: skip
417            networking: skip
418            # FIXME: Networking Tests fail due to missing OpenSSL
419            # https://github.com/LiveSplit/livesplit-core/issues/308
420            software_rendering: skip
421            # TODO: The software rendering is apparently not working on big
422            # endian platforms. Almost definitely caused by tiny-skia. This may
423            # or may not be intentional.
424
425          - label: Linux mips64
426            target: mips64-unknown-linux-gnuabi64
427            os: ubuntu-latest
428            auto_splitting: skip
429            networking: skip
430            # FIXME: Networking Tests fail due to missing OpenSSL
431            # https://github.com/LiveSplit/livesplit-core/issues/308
432            software_rendering: skip
433            # TODO: The software rendering is apparently not working on big
434            # endian platforms. Almost definitely caused by tiny-skia. This may
435            # or may not be intentional.
436
437          - label: Linux mips64el
438            target: mips64el-unknown-linux-gnuabi64
439            os: ubuntu-latest
440            auto_splitting: skip
441            networking: skip
442            # FIXME: Networking Tests fail due to missing OpenSSL
443            # https://github.com/LiveSplit/livesplit-core/issues/308
444
445          - label: Linux mipsel
446            target: mipsel-unknown-linux-gnu
447            os: ubuntu-latest
448            auto_splitting: skip
449            networking: skip
450            # FIXME: Networking Tests fail due to missing OpenSSL
451            # https://github.com/LiveSplit/livesplit-core/issues/308
452
453          - label: Linux mipsel musl
454            target: mipsel-unknown-linux-musl
455            os: ubuntu-latest
456            tests: skip
457            dylib: skip
458
459          - label: Linux powerpc
460            target: powerpc-unknown-linux-gnu
461            os: ubuntu-latest
462            tests: skip
463
464          - label: Linux powerpc64le
465            target: powerpc64le-unknown-linux-gnu
466            os: ubuntu-latest
467            tests: skip
468
469          - label: Linux s390x
470            target: s390x-unknown-linux-gnu
471            os: ubuntu-latest
472            tests: skip
473
474          # These got removed from cross
475          # - label: Linux powerpc64
476          #   target: powerpc64-unknown-linux-gnu
477          #   os: ubuntu-latest
478          #   tests: skip
479          #   # FIXME: Networking Tests fail due to missing OpenSSL
480          #   # https://github.com/LiveSplit/livesplit-core/issues/308
481
482          # - label: Linux sparc64
483          #   target: sparc64-unknown-linux-gnu
484          #   os: ubuntu-latest
485          #   tests: skip
486
487          # macOS
488          - label: macOS aarch64
489            target: aarch64-apple-darwin
490            os: macOS-latest
491            cross: skip
492            tests: skip
493            install_target: true
494          # FIXME: Switch OS to ARM macOS once GitHub Actions provides that,
495          # use the toolchain instead of the target and run the tests.
496
497          - label: macOS x86_64
498            target: x86_64-apple-darwin
499            os: macOS-latest
500            cross: skip
501
502          # iOS
503          - label: iOS aarch64
504            target: aarch64-apple-ios
505            os: macOS-latest
506            cross: skip
507            dylib: skip
508            tests: skip
509            install_target: true
510
511          - label: iOS x86_64
512            target: x86_64-apple-ios
513            os: macOS-latest
514            cross: skip
515            dylib: skip
516            tests: skip
517            install_target: true
518
519          # Android
520          - label: Android i686
521            target: i686-linux-android
522            os: ubuntu-latest
523            tests: skip
524
525          - label: Android x86_64
526            target: x86_64-linux-android
527            os: ubuntu-latest
528            tests: skip
529             # The tests fail with an illegal instruction since 1.40
530             # https://github.com/rust-lang/rust/issues/67582
531
532          - label: Android arm
533            target: arm-linux-androideabi
534            os: ubuntu-latest
535            tests: skip
536
537          - label: Android armv7
538            target: armv7-linux-androideabi
539            os: ubuntu-latest
540            tests: skip
541
542          - label: Android aarch64
543            target: aarch64-linux-android
544            os: ubuntu-latest
545            tests: skip
546
547          # *BSD
548          - label: NetBSD x86_64
549            target: x86_64-unknown-netbsd
550            os: ubuntu-latest
551            tests: skip
552
553          # Solaris
554          # - label: Solaris x86_64
555          #   target: x86_64-sun-solaris
556          #   os: ubuntu-latest
557          #   tests: skip
558          #   dylib: skip
559          # FIXME: Solaris stopped working. core isn't available:
560          # https://github.com/LiveSplit/livesplit-core/runs/2777745289?check_suite_focus=true
561
562          # Testing other channels
563          - label: Windows Beta
564            target: x86_64-pc-windows-msvc
565            os: windows-latest
566            toolchain: beta
567            release: skip
568            cross: skip
569
570          - label: Windows Nightly
571            target: x86_64-pc-windows-msvc
572            os: windows-latest
573            toolchain: nightly
574            release: skip
575            cross: skip
576
577          - label: Windows Beta gnu
578            target: x86_64-pc-windows-gnu
579            toolchain: beta-x86_64-pc-windows-gnu
580            release: skip
581            os: windows-latest
582            cross: skip
583            install_target: true
584
585          - label: Windows Nightly gnu
586            target: x86_64-pc-windows-gnu
587            toolchain: nightly-x86_64-pc-windows-gnu
588            release: skip
589            os: windows-latest
590            cross: skip
591            install_target: true
592
593          - label: Linux Beta
594            target: x86_64-unknown-linux-gnu
595            os: ubuntu-latest
596            toolchain: beta
597            release: skip
598
599          - label: Linux Nightly
600            target: x86_64-unknown-linux-gnu
601            os: ubuntu-latest
602            toolchain: nightly
603            release: skip
604
605          - label: macOS Beta
606            target: x86_64-apple-darwin
607            os: macOS-latest
608            toolchain: beta
609            release: skip
610            cross: skip
611
612          - label: macOS Nightly
613            target: x86_64-apple-darwin
614            os: macOS-latest
615            toolchain: nightly
616            release: skip
617            cross: skip
618
619    steps:
620      - name: Checkout Commit
621        uses: actions/checkout@v2
622
623      - name: Install Rust
624        uses: hecrj/setup-rust-action@v1
625        with:
626          rust-version: ${{ matrix.toolchain || 'stable' }}
627
628      - name: Install Target
629        if: matrix.install_target != ''
630        run: rustup target add ${{ matrix.target }}
631
632      - name: Install cross
633        if: matrix.cross == '' && matrix.no_std == ''
634        run: cargo install cross
635
636      - name: Build Static Library
637        run: sh .github/workflows/build_static.sh
638        env:
639          TARGET: ${{ matrix.target }}
640          SKIP_CROSS: ${{ matrix.cross }}
641          IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
642          FEATURES: ${{ matrix.features }}
643          NO_STD: ${{ matrix.no_std }}
644
645      - name: Build Shared Library
646        if: matrix.dylib == ''
647        run: sh .github/workflows/build_shared.sh
648        env:
649          TARGET: ${{ matrix.target }}
650          SKIP_CROSS: ${{ matrix.cross }}
651          IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
652          FEATURES: ${{ matrix.features }}
653
654      - name: Test
655        if: matrix.tests == ''
656        run: sh .github/workflows/test.sh
657        env:
658          TARGET: ${{ matrix.target }}
659          SKIP_CROSS: ${{ matrix.cross }}
660          SKIP_AUTO_SPLITTING: ${{ matrix.auto_splitting }}
661          SKIP_NETWORKING: ${{ matrix.networking }}
662          SKIP_SOFTWARE_RENDERING: ${{ matrix.software_rendering }}
663
664      - name: Prepare Release
665        if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
666        shell: bash
667        run: .github/workflows/before_deploy.sh
668        env:
669          OS_NAME: ${{ matrix.os }}
670          TARGET: ${{ matrix.target }}
671
672      - name: Release
673        if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
674        uses: softprops/action-gh-release@v1
675        with:
676          files: livesplit-core-*.*
677        env:
678          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
679
680  bind_gen:
681    name: Generate bindings
682    runs-on: ubuntu-latest
683    steps:
684      - name: Checkout Commit
685        uses: actions/checkout@v2
686
687      - name: Install Rust
688        uses: hecrj/setup-rust-action@v1
689
690      - name: Generate bindings
691        run: |
692          cd capi/bind_gen
693          cargo run
694          cd ../..
695
696  clippy:
697    name: Check clippy lints
698    runs-on: ubuntu-latest
699    steps:
700      - name: Checkout Commit
701        uses: actions/checkout@v2
702
703      - name: Install Rust
704        uses: hecrj/setup-rust-action@v1
705        with:
706          components: clippy
707
708      - name: Run Clippy
709        run: cargo clippy --all-features
710
711  format:
712    name: Check formatting
713    runs-on: ubuntu-latest
714    steps:
715      - name: Checkout Commit
716        uses: actions/checkout@v2
717
718      - name: Install Rust
719        uses: hecrj/setup-rust-action@v1
720        with:
721          components: rustfmt
722
723      - name: Run cargo fmt
724        run: cargo fmt -- --check || true
725
726  bench:
727    name: Run benchmarks
728    runs-on: ubuntu-latest
729    env:
730      CRITERION_TOKEN: ${{ secrets.CRITERION_TOKEN }}
731    steps:
732      - name: Checkout
733        uses: actions/checkout@v2
734
735      - name: Install Rust
736        uses: hecrj/setup-rust-action@v1
737
738      - name: Run benchmarks
739        run: |
740          # run benchmarks and save baseline to "criterion.dev.temp"
741          cargo bench --all-features -- --verbose --noplot --save-baseline criterion.dev.temp
742
743      # # set the path to the file to upload to criterion.dev
744      # echo "CRITERION_FILE_PATH=$(find ./target/criterion/ -name raw.csv)" >> $GITHUB_ENV
745
746      # - name: Upload benchmarks
747      #   run: |
748      #     # upload the file
749      #     curl -F 'raw.csv=@${{ env.CRITERION_FILE_PATH }}' \
750      #     'https://api.criterion.dev/v1/${{ github.repository }}/measurements?token=${{ secrets.CRITERION_TOKEN }}&commit=${{ github.sha }}'
751
752  docs:
753    name: Generate documentation
754    if: startsWith(github.ref, 'refs/tags/')
755    runs-on: ubuntu-latest
756    steps:
757      - uses: actions/checkout@master
758      - name: Use Node 10
759        uses: actions/setup-node@v1
760        with:
761          node-version: '10.x'
762      - name: Build TypeScript documentation
763        run: |
764          cd capi/js
765          make docs
766          cd ../..
767      - name: Upload documentation files
768        run: |
769          git config --global user.email "action@github.com"
770          git config --global user.name "GitHub Action"
771          git clone -q "https://github.com/LiveSplit/livesplit-core-docs"
772          cd livesplit-core-docs
773          rm -r *
774          mv ../docs/* .
775          git add .
776          git commit --amend -m "Update documentation"
777          git push --force https://action:${{ secrets.LIVESPLIT_CORE_DOCS_UPLOAD }}@github.com/LiveSplit/livesplit-core-docs.git