-
Notifications
You must be signed in to change notification settings - Fork 20
72 lines (64 loc) · 1.79 KB
/
rust.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
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
lints-and-checks:
name: Lints and checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy, rust-docs
- name: Rustfmt lints
run: cargo fmt --all -- --check
- name: Clippy lints
run: cargo clippy --no-deps -- -D warnings
- name: Build docs
run: RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --no-deps
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
- "1.65" # MSRV
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Install Rust (thumbv7em)
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: thumbv7em-none-eabihf
- name: Build - default features
run: cargo build
- name: Build - std
run: cargo build --features "std"
- name: Build - serde
run: cargo build --features "serde"
- name: Build - defmt-03
run: cargo build --features "defmt-03"
- name: Build - examples
run: cargo build --examples
- name: Run tests
run: cargo test
- name: Install cargo-fuzz
# pre-build binaries
uses: taiki-e/install-action@v2
with:
tool: cargo-fuzz
- name: Fuzz (nightly only)
if: ${{ matrix.rust == 'nightly' }}
run: |
cargo +nightly fuzz run init -- -max_total_time=900
cargo +nightly fuzz run calibrate -- -max_total_time=1800