Skip to content

Commit

Permalink
Merge pull request #56 from japaric/ci-no-std-support-check
Browse files Browse the repository at this point in the history
CI: check no-std support
  • Loading branch information
franziskuskiefer committed Nov 29, 2023
2 parents 8f66bf3 + d8ea398 commit e56ea4a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,18 @@ jobs:
version: latest
- name: Fuzz Base w/ RustCrypto
run: cargo fuzz run base -- -runs=10000

no-std-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# we use a target that lacks a pre-compiled libstd to check if any dependency is using libstd
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7em-none-eabihf
default: true
- name: build crates in no-std mode
run: cargo check --target thumbv7em-none-eabihf
working-directory: no-std-support-check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Cargo.lock
**/*.rs.bk
.vscode/
evercrypt_provider/target
no-std-support-check/target
rust_crypto_provider/target
traits/target/
.DS_Store
Expand Down
15 changes: 15 additions & 0 deletions no-std-support-check/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
edition = "2021"
name = "no-std-support-check"
publish = false
version = "0.0.0"

[dependencies]
hpke-rs = { path = ".." }
hpke-rs-crypto = { path = "../traits" }
hpke-rs-rust-crypto = { path = "../rust_crypto_provider" }

# the no-std-support-check CI job uses the `thumbv7em-none-eabihf` target
# `getrandom` does not support that target out of box so this feature needs to be enabled to avoid a compilation error
# (normally this feature should NOT be enabled in a library but this crate is just used for a CI check)
getrandom = { version = "0.2.11", features = ["custom"] }
3 changes: 3 additions & 0 deletions no-std-support-check/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! used in CI to check that crates are no-std compatible

#![no_std]

0 comments on commit e56ea4a

Please sign in to comment.