-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (79 loc) · 2.27 KB
/
crate.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
name: Crate
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
GRCOV_VERSION: v0.8.19
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
test-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
uses: taiki-e/install-action@v2
with:
tool: wasm-pack
- name: Run tests
run: wasm-pack test --headless --chrome --firefox
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust nightly and miri
uses: dtolnay/rust-toolchain@nightly
with:
components: miri, rust-src
- name: Run miri
env:
RUSTFLAGS: -Zrandomize-layout
MIRIFLAGS: -Zmiri-symbolic-alignment-check
run: cargo miri test
code-coverage:
needs: [miri, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable and LLVM tools
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install grcov
run: |
curl -L "https://github.com/mozilla/grcov/releases/download/$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" | \
tar xj -C "$HOME/.cargo/bin"
- name: Run cargo clean
run: cargo clean
- name: Run tests
env:
LLVM_PROFILE_FILE: "v_frame-%p-%m.profraw"
RUSTFLAGS: >
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code
-Coverflow-checks=off
RUSTDOCFLAGS: >
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code
-Coverflow-checks=off
run: cargo test
- name: Get coverage data for codecov
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
--ignore-not-existing --ignore "/*" --ignore "../*" -o lcov.info
- name: Codecov upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info