Skip to content

Commit c7fbeae

Browse files
committed
Test a full no-std build in the no-std-check crate in CI
Rust is incredibly forgiving in attempts to access `std`, making it rather difficult to test `no-std` properly. In practice, the only decent way to do so is to actually build for a platform that does not have `std`, which we do here by building the `no-std-check` crate for `arm-thumbv7m-none-eabi`.
1 parent 1d0b44e commit c7fbeae

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ jobs:
128128
# check no-std compatibility across dependencies
129129
cd no-std-check
130130
cargo check --verbose --color always
131+
rustup target add thumbv7m-none-eabi
132+
apt-get -y install gcc-arm-none-eabi
133+
cargo build --target=thumbv7m-none-eabi
131134
cd ..
132135
- name: Test on no-std builds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
133136
if: "matrix.build-no-std && matrix.coverage"

no-std-check/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#![no_std]

0 commit comments

Comments
 (0)