-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (67 loc) · 1.84 KB
/
Copy pathtest.yml
File metadata and controls
76 lines (67 loc) · 1.84 KB
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
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- codec: postcard
features: "--all-features"
- codec: pot
features: "--no-default-features --features iter-ext,codec-pot"
name: clippy (${{ matrix.codec }})
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy ${{ matrix.features }} -- -D warnings
doc-test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- codec: postcard
features: "--all-features"
- codec: pot
features: "--no-default-features --features iter-ext,macros,codec-pot"
name: doc-test (${{ matrix.codec }})
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run doctest
run: cargo test --doc ${{ matrix.features }}
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- codec: postcard
script: "npm test"
- codec: pot
script: "npm run test:pot"
name: test (${{ matrix.codec }})
steps:
- uses: actions/checkout@v4
- name: Install npm
working-directory: ./test
run: npm ci
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Run tests
working-directory: ./test
run: ${{ matrix.script }}