blob: 3430ad1b9c45876f9de7a78b2ae981bc0ce5c3ff [file] [log] [blame]
David LeGare0ba713b2022-03-01 18:56:31 +00001name: CI
2permissions:
3 contents: read
4on:
5 pull_request:
6 paths-ignore:
7 - README.md
8 push:
9 branches: main
10 paths-ignore:
11 - README.md
12
13jobs:
14 build:
15 runs-on: ubuntu-latest
16 strategy:
17 matrix:
18 rust:
19 - stable
20 - beta
21 - nightly-2022-01-01
22 steps:
23 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
24 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
25 with:
26 profile: minimal
27 toolchain: ${{ matrix.rust }}
28 components: rustfmt
29 override: true
30 - run: cargo build --release --workspace
31
32 test:
33 runs-on: ubuntu-latest
34 strategy:
35 matrix:
36 rust:
37 - stable
38 - beta
39 - nightly-2022-01-01
40 steps:
41 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
42 with:
43 submodules: true
44 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
45 with:
46 profile: minimal
47 toolchain: ${{ matrix.rust }}
48 components: rustfmt
49 override: true
50 - run: cargo test --workspace -- --nocapture
51
52 no_std:
53 name: Build for a no_std target
54 runs-on: ubuntu-latest
55 strategy:
56 matrix:
57 rust:
58 - stable
59 - beta
60 - nightly-2022-01-01
61 steps:
62 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
63 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
64 with:
65 profile: minimal
66 toolchain: ${{ matrix.rust }}
67 components: rustfmt
68 target: thumbv6m-none-eabi
69 override: true
70 - run: cargo build --release --workspace --target thumbv6m-none-eabi
71
72 msrv:
73 name: Rust ${{matrix.rust}} MSRV
74 runs-on: ubuntu-latest
75 strategy:
76 fail-fast: false
77 matrix:
78 rust: [1.56.0, 1.57.0]
79 steps:
80 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
81 with:
82 submodules: true
83 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
84 with:
85 profile: minimal
86 toolchain: ${{ matrix.rust }}
87 components: rustfmt
88 override: true
89 - run: rustc --version
90 - run: cargo build --release --workspace --all-features
91
92 formatting:
93 runs-on: ubuntu-latest
94 steps:
95 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
96 - uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2
97 - run: go get github.com/campoy/embedmd
98 - uses: actions/setup-ruby@b007fae6f1ffbe3a51c00a6df6f5ff01184d5340 # v1
99 - run: gem install mdl
100 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
101 with:
102 profile: minimal
103 toolchain: nightly-2022-01-01
104 override: true
105 components: rustfmt
106 - run: cargo fmt --all -- --check
107 - run: scripts/check-format.sh
108
109 clippy:
110 runs-on: ubuntu-latest
111 steps:
112 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
113 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
114 with:
115 profile: minimal
116 toolchain: nightly-2022-01-01
117 override: true
118 components: rustfmt, clippy
119 - run: cargo clippy --all-features --all-targets
120 - run: git diff --exit-code
121
122 doc:
123 runs-on: ubuntu-latest
124 steps:
125 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
126 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
127 with:
128 profile: minimal
129 toolchain: stable
130 - run: RUSTDOCFLAGS="-Dwarnings" cargo doc --no-deps --document-private-items
131
132 udeps:
133 runs-on: ubuntu-latest
134 steps:
135 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
136 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
137 with:
138 profile: minimal
139 toolchain: nightly-2022-01-01
140 override: true
141 components: rustfmt
142 - uses: actions-rs/install@69ec87709ffb5b19a7b5ddbf610cb221498bb1eb # v0.1.2
143 with:
144 crate: cargo-udeps
145 use-tool-cache: true
146 version: 0.1.25
147 - run: cargo udeps
148
149 deny:
150 runs-on: ubuntu-latest
151 steps:
152 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
153 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
154 with:
155 profile: minimal
156 toolchain: nightly-2022-01-01
157 override: true
158 components: rustfmt
159 - run: cargo install --locked --version 0.8.5 cargo-deny
160 - run: cargo deny check
161
162 coverage:
163 runs-on: ubuntu-latest
164 steps:
165 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
166 with:
167 submodules: true
168 fetch-depth: 0
169 - uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
170 with:
171 profile: minimal
172 toolchain: nightly-2022-01-01
173 override: true
174 components: rustfmt
175 - uses: actions-rs/install@69ec87709ffb5b19a7b5ddbf610cb221498bb1eb # v0.1.2
176 with:
177 crate: cargo-tarpaulin
178 use-tool-cache: true
179 - run: cargo tarpaulin --verbose --ignore-tests --all-features --timeout=600 --out Xml
180 - name: Upload to codecov.io
181 run: |
182 bash <(curl -s https://codecov.io/bash)