-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (77 loc) · 2.19 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
73
74
75
76
77
78
79
80
81
82
name: Build
on: [ push, pull_request, merge_group ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: "${{ matrix.runs-on }}"
strategy:
matrix:
runs-on:
- windows-latest
- ubuntu-latest
rust:
- stable
- nightly
- 1.76.0 # MSVR
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- name: Build
run: cargo build --all-targets --verbose --features alloc
# use some arbitrary no_std target
- name: Install no_std target thumbv7em-none-eabihf
run: rustup target add thumbv7em-none-eabihf
- name: Build (no_std)
run: cargo build --verbose --target thumbv7em-none-eabihf --features alloc
- name: Run tests
run: cargo test --verbose --features alloc
miri:
runs-on: "${{ matrix.runs-on }}"
needs:
# Logical dependency and wait for cache to be present
- build
strategy:
matrix:
runs-on:
- ubuntu-latest
rust:
- nightly
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- run: rustup component add miri
- run: cargo miri test --tests
style_checks:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --features alloc
- name: Rustdoc
run: cargo doc --no-deps --document-private-items --features alloc