-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.69 KB
/
main.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
name: Main
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Environment
run: |
rustup update stable
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown
rustup component add rustfmt --toolchain nightly
- name: Build for wasm
# Check if the library target compiles. This will still allow for using
# non-wasm functionality in tests and benchmarks but guarantees that
# consumers of the library can use it to generate wasm bindings.
run: cargo check --target wasm32-unknown-unknown --lib
- name: Rustfmt
run: cargo +nightly fmt --all -- --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Test
run: cargo test
sia_js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Environment
run: |
rustup update stable
cargo install wasm-pack
- name: Test Browser JS
working-directory: sia_js
run: |
wasm-pack test --headless --${{matrix.browser}} -- --features=test_in_browser
- name: Test JS Firefox
working-directory: sia_js
run: |
wasm-pack test --headless --firefox -- --features=test_in_browser
- name: Test JS node.js
working-directory: sia_js
run: |
wasm-pack test --node
- name: Build JS node.js
working-directory: sia_js
run: wasm-pack build --target=nodejs
- name: Build JS browser
working-directory: sia_js
run: wasm-pack build --target=web