Browse Source

ci: Build ensure_no_std to verify std/alloc are optional

JC 2 years ago
parent
commit
3dfac9a4f3
1 changed files with 7 additions and 0 deletions
  1. 7 0
      .github/workflows/ci.yml

+ 7 - 0
.github/workflows/ci.yml

@@ -43,8 +43,15 @@ jobs:
       - run: cargo install cargo-readme
       - run: cargo install cargo-readme
       - run: cargo fmt --check
       - run: cargo fmt --check
       - run: cargo test
       - run: cargo test
+
+      # Ensure that the library doesn't depend on std/alloc. A binary
+      # that depends on the library is used for this (instead of
+      # directly build the library), otherwise accidentally depending on
+      # `alloc` would not result in an error.
       - name: cargo build no_std
       - name: cargo build no_std
         run: cargo build --target thumbv7m-none-eabi --no-default-features
         run: cargo build --target thumbv7m-none-eabi --no-default-features
+        working-directory: ci/ensure_no_std
+
       - run: cargo clippy --all-features
       - run: cargo clippy --all-features
       - run: cargo doc --all-features
       - run: cargo doc --all-features
       - name: Ensure README.md is updated
       - name: Ensure README.md is updated