Skip to content

Commit 2379d33

Browse files
committed
Add GitHub Actions CI configuration
1 parent 5426b17 commit 2379d33

File tree

2 files changed

+87
-2
lines changed

2 files changed

+87
-2
lines changed

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
check:
10+
name: Check
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
mcu:
15+
- stm32f301
16+
- stm32f318
17+
- stm32f302xb
18+
- stm32f302xc
19+
- stm32f302xd
20+
- stm32f302xe
21+
- stm32f303xb
22+
- stm32f303xc
23+
- stm32f303xd
24+
- stm32f303xe
25+
- stm32f303x6
26+
- stm32f303x8
27+
- stm32f373
28+
- stm32f378
29+
- stm32f334
30+
- stm32f328
31+
- stm32f358
32+
- stm32f398
33+
features: ["rt"]
34+
include:
35+
- mcu: stm32f303xc
36+
features: rt,stm32-usbd
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: actions-rs/toolchain@v1
40+
with:
41+
toolchain: stable
42+
target: thumbv7em-none-eabihf
43+
override: true
44+
profile: minimal
45+
- uses: actions-rs/cargo@v1
46+
with:
47+
command: check
48+
args: --features=${{ matrix.mcu }},${{ matrix.features }}
49+
50+
clippy:
51+
name: Clippy
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: actions-rs/toolchain@v1
56+
with:
57+
toolchain: nightly
58+
target: thumbv7em-none-eabihf
59+
override: true
60+
profile: minimal
61+
components: clippy
62+
- uses: actions-rs/clippy-check@v1
63+
with:
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
args: >
66+
--features=stm32f303xc,rt,stm32-usbd --examples
67+
-- -D warnings
68+
69+
rustfmt:
70+
name: Rustfmt
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v2
74+
- uses: actions-rs/toolchain@v1
75+
with:
76+
toolchain: stable
77+
override: true
78+
profile: minimal
79+
components: rustfmt
80+
- uses: actions-rs/cargo@v1
81+
with:
82+
command: fmt
83+
args: --all -- --check

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ cortex-m-semihosting = "0.3"
5353

5454
[features]
5555
default = ["unproven"]
56+
unproven = ["embedded-hal/unproven"]
5657
device-selected = []
5758
direct-call-deprecated = []
5859
rt = ["stm32f3/rt"]
59-
# Any Changes here should be mirrored in README.md and src/lib.rs
60+
61+
# Any Changes here should be mirrored in README.md, src/lib.rs, and
62+
# .github/workflows/ci.yml.
6063
stm32f301 = ["stm32f3/stm32f301", "device-selected"]
6164
stm32f318 = ["stm32f3/stm32f301", "device-selected"]
6265
stm32f302 = ["stm32f3/stm32f302", "direct-call-deprecated"]
@@ -77,7 +80,6 @@ stm32f334 = ["stm32f3/stm32f3x4", "device-selected"]
7780
stm32f328 = ["stm32f3/stm32f3x8", "device-selected"]
7881
stm32f358 = ["stm32f3/stm32f3x8", "device-selected"]
7982
stm32f398 = ["stm32f3/stm32f3x8", "device-selected"]
80-
unproven = ["embedded-hal/unproven"]
8183

8284
[profile.dev]
8385
debug = true

0 commit comments

Comments
 (0)