-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (62 loc) · 1.84 KB
/
build.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
name: Build
on: [push]
# Stops the running workflow of previous pushes
concurrency:
# cancel per workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Lint, test and build rust-${{ matrix.toolchain }} ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
target:
- thumbv7em-none-eabi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust setup rust-${{ matrix.toolchain }} ${{ matrix.target }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
components: clippy, rustfmt
- id: cache-rust
uses: Swatinem/rust-cache@v2
- name: Lint - rustfmt
run: cargo fmt --all -- --check
- name: Lint - clippy
run: cargo clippy --all --no-deps -- -D warnings
- name: Check
run: cargo check
- name: Test
run: cargo test --verbose --lib --bins --tests --benches --example angle
- name: Add nightly to build docs
run: rustup toolchain install nightly
- name: Build docs with --all-features
env:
RUSTDOCFLAGS: -D warnings --cfg docsrs
run: cargo +nightly doc --no-deps --all-features
test-no_std_fixed:
name: Test no_std_fixed rust-${{ matrix.toolchain }} ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
toolchain:
- nightly
target:
- thumbv7em-none-eabi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
- run: cargo test --verbose --example no_std_fixed