From 59f1fd8402a9c717c6e86ec07454a9c51d6738a5 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 21 Oct 2023 21:45:43 +0700 Subject: [PATCH] Fix `no_std` build, add to CI. (#325) This had been broken in b0e296024403d0daf7f7f1658a26f573f838f8ac. --- .github/workflows/main.yml | 14 ++++++++++++++ src/lib.rs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3663611..5752cd0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,11 +62,25 @@ jobs: working-directory: fuzz run: ./travis-fuzz.sh + no-std: + name: no_std + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + target: thumbv7m-none-eabi + - name: Cargo build + run: cargo build --verbose + build_result: name: homu build finished runs-on: ubuntu-latest needs: - "linux-ci" + - "no-std" steps: - name: Mark the job as successful diff --git a/src/lib.rs b/src/lib.rs index a54a8de..0ff1c86 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,7 +55,7 @@ #[doc(hidden)] pub extern crate alloc; -// #[cfg(any(test, feature = "write"))] +#[cfg(any(test, feature = "write"))] extern crate std; #[cfg(test)]