Skip to content

Commit e56ea4a

Browse files
Merge pull request #56 from japaric/ci-no-std-support-check
CI: check no-std support
2 parents 8f66bf3 + d8ea398 commit e56ea4a

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.github/workflows/rust.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,18 @@ jobs:
108108
version: latest
109109
- name: Fuzz Base w/ RustCrypto
110110
run: cargo fuzz run base -- -runs=10000
111+
112+
no-std-check:
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v2
116+
# we use a target that lacks a pre-compiled libstd to check if any dependency is using libstd
117+
- name: Install stable toolchain
118+
uses: actions-rs/toolchain@v1
119+
with:
120+
toolchain: stable
121+
target: thumbv7em-none-eabihf
122+
default: true
123+
- name: build crates in no-std mode
124+
run: cargo check --target thumbv7em-none-eabihf
125+
working-directory: no-std-support-check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Cargo.lock
33
**/*.rs.bk
44
.vscode/
55
evercrypt_provider/target
6+
no-std-support-check/target
67
rust_crypto_provider/target
78
traits/target/
89
.DS_Store

no-std-support-check/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
edition = "2021"
3+
name = "no-std-support-check"
4+
publish = false
5+
version = "0.0.0"
6+
7+
[dependencies]
8+
hpke-rs = { path = ".." }
9+
hpke-rs-crypto = { path = "../traits" }
10+
hpke-rs-rust-crypto = { path = "../rust_crypto_provider" }
11+
12+
# the no-std-support-check CI job uses the `thumbv7em-none-eabihf` target
13+
# `getrandom` does not support that target out of box so this feature needs to be enabled to avoid a compilation error
14+
# (normally this feature should NOT be enabled in a library but this crate is just used for a CI check)
15+
getrandom = { version = "0.2.11", features = ["custom"] }

no-std-support-check/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! used in CI to check that crates are no-std compatible
2+
3+
#![no_std]

0 commit comments

Comments
 (0)