Skip to content

Commit 5a1c06e

Browse files
authored
Fix Github Actions CI config (#130)
The previous CI executed the `cargo check` command with the `--examples` flag. The intention was to check both the library itself and the examples. However, for most MCU versions we don't provide any examples, they are explicitly feature gated to stm32f303 devices. In these cases cargo decides that there is nothing to do, so it also doesn't check the library itself, effectively disabling checking for most MCU families. We instead want to use the `--all-features` flag. From the cargo docs: "Check all targets. This is equivalent to specifying --lib --bins --tests --benches --examples." However, this doesn't work unfortunately since cargo is complaining about a missing crate "test" for the thumb7em-none-eabihf target. So instead we explicitly use `--lib --examples`. This commit also updates the checkout action to v2 since the bug that existed in this version is officially fixed now.
1 parent fead2eb commit 5a1c06e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Note: The checkout@v2 action sometimes checks out the wrong commit:
2-
# https://github.com/actions/checkout/issues/237
3-
# Until that is fixed we use checkout@v1 here instead.
4-
51
name: CI
62

73
on:
@@ -39,7 +35,7 @@ jobs:
3935
- mcu: stm32f303xc
4036
features: rt,stm32-usbd
4137
steps:
42-
- uses: actions/checkout@v1
38+
- uses: actions/checkout@v2
4339
- uses: actions-rs/toolchain@v1
4440
with:
4541
toolchain: stable
@@ -49,13 +45,13 @@ jobs:
4945
- uses: actions-rs/cargo@v1
5046
with:
5147
command: check
52-
args: --features=${{ matrix.mcu }},${{ matrix.features }} --examples
48+
args: --features=${{ matrix.mcu }},${{ matrix.features }} --lib --examples
5349

5450
clippy:
5551
name: Clippy
5652
runs-on: ubuntu-latest
5753
steps:
58-
- uses: actions/checkout@v1
54+
- uses: actions/checkout@v2
5955
- uses: actions-rs/toolchain@v1
6056
with:
6157
toolchain: nightly
@@ -67,14 +63,14 @@ jobs:
6763
with:
6864
token: ${{ secrets.GITHUB_TOKEN }}
6965
args: >
70-
--features=stm32f303xc,rt,stm32-usbd --examples
66+
--features=stm32f303xc,rt,stm32-usbd --lib --examples
7167
-- -D warnings
7268
7369
rustfmt:
7470
name: Rustfmt
7571
runs-on: ubuntu-latest
7672
steps:
77-
- uses: actions/checkout@v1
73+
- uses: actions/checkout@v2
7874
- uses: actions-rs/toolchain@v1
7975
with:
8076
toolchain: stable

0 commit comments

Comments
 (0)