Skip to content

CI: test build on actual no_std platforms #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions .github/workflows/rustls-rustcrypto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ env:
RUSTFLAGS: "-Dwarnings"

jobs:
build:
strategy:
matrix:
toolchain:
- 1.75.0 # MSRV
- stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo build
- name: Test no_std with alloc build
run: cargo build --no-default-features --features tls12,alloc

clippy:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -63,10 +46,30 @@ jobs:
components: rustfmt
- run: cargo fmt --all -- --check

no_std:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.75.0 # MSRV
- stable
target:
- armv7a-none-eabi
- thumbv7em-none-eabi
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- run: cargo build --no-default-features --features tls12,alloc --release --target ${{ matrix.target }}

test:
strategy:
matrix:
toolchain:
- 1.75.0 # MSRV
- stable
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ categories = ["cryptography", "no-std"]
keywords = ["rustls", "tls"]
edition = "2021"
rust-version = "1.75"
resolver = "1" # Hack to enable the `custom` feature of `getrandom`

# Ensure all dependencies + feats are mapped to crate features for correct usage
# default features often have std breaking no_std and potentially other unwanted
Expand Down Expand Up @@ -40,6 +41,9 @@ signature = { version = "2.1.0", default-features = false }
webpki = { package = "rustls-webpki", version = "0.102.0", default-features = false }
x25519-dalek = { version = "2", default-features = false }

[dev-dependencies]
getrandom = { version = "0.2", features = ["custom"] } # workaround to build on no_std targets

[features]
default = ["std", "tls12", "zeroize"]
logging = ["rustls/logging"]
Expand Down
Loading