Skip to content
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

Add CI profile for smaller binary sizes and use it in GitHub Actions #1292

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 16 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
--lib
--no-default-features
--target x86_64-unknown-none
--profile ci
--verbose
- name: Build (no_std + hash-collections)
run: >-
Expand All @@ -45,6 +46,7 @@ jobs:
--no-default-features
--features hash-collections
--target x86_64-unknown-none
--profile ci
--verbose
- name: Build (no_std + wasm32)
run: >-
Expand All @@ -55,6 +57,7 @@ jobs:
--lib
--no-default-features
--target wasm32-unknown-unknown
--profile ci
--verbose
- name: Build (CMake)
run: |
Expand All @@ -79,11 +82,17 @@ jobs:
- name: Build Tests
env:
RUSTFLAGS: "-C debug-assertions -Zsanitizer=address"
run: cargo build --tests --workspace --locked -Zbuild-std --target x86_64-unknown-linux-gnu --verbose
run: cargo build --tests --workspace --locked -Zbuild-std --target x86_64-unknown-linux-gnu --verbose --profile ci
- name: Test
env:
RUSTFLAGS: "-C debug-assertions -Zsanitizer=address"
run: cargo test --workspace --locked --tests -Zbuild-std --target x86_64-unknown-linux-gnu
run: >-
cargo test --workspace
--locked
--tests
-Zbuild-std
--target x86_64-unknown-linux-gnu
--profile ci

min-version:
name: Check mininum supported Rust version
Expand All @@ -95,6 +104,7 @@ jobs:
- run: >-
cargo check
--workspace
--profile ci
--exclude wasmi_fuzz
--exclude fuzz

Expand All @@ -114,19 +124,19 @@ jobs:
- name: Build (default features)
env:
RUSTFLAGS: "-C debug-assertions"
run: cargo build --tests --workspace --locked --verbose
run: cargo build --tests --workspace --locked --profile ci --verbose
- name: Test (default features)
env:
RUSTFLAGS: "-C debug-assertions"
run: cargo test --workspace --locked
run: cargo test --workspace --profile ci --locked
- name: Build (all features)
env:
RUSTFLAGS: "-C debug-assertions"
run: cargo build --tests --workspace --locked --all-features --verbose
run: cargo build --tests --workspace --locked --profile ci --all-features --verbose
- name: Test (all features)
env:
RUSTFLAGS: "-C debug-assertions"
run: cargo test --workspace --locked --all-features
run: cargo test --workspace --locked --profile ci --all-features

fmt:
name: Formatting
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ wasmi_wast = { version = "0.39.0", path = "crates/wast" }
[profile.bench]
lto = "fat"
codegen-units = 1

[profile.ci]
inherits = "dev"
debug-assertions = true
overflow-checks = true
debug = "limited"
lto = "thin"
opt-level = "s"
Loading