Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ runs:

if [ "${{ inputs.toolchain }}" = "nightly" ]; then
rustup target add wasm32-wasip3
rustup component add rustfmt
rustup component add clippy
fi

# Save disk space by avoiding incremental compilation. Also turn down
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ jobs:
- name: rust version
run: cargo --version

- name: check
run: cargo check --workspace --all --bins --examples
- name: check p2
run: cargo check --workspace --all --bins --examples --target wasm32-wasip2

# TODO: remove all nightly conditions for p3 targets once wasm32-wasip3 is
# stable.
- name: check p3
if: matrix.rust == 'nightly'
run: cargo check --workspace --all --bins --examples --target wasm32-wasip3

- name: wstd p2 tests
run: cargo test -p wstd -p wstd-axum --target wasm32-wasip2 -- --nocapture
Expand All @@ -75,15 +81,22 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: ./.github/actions/install-rust
with:
toolchain: nightly

- name: fmt
run: cargo fmt --all -- --check

- name: Docs
run: cargo doc
run: |
cargo doc --target wasm32-wasip2
cargo doc --target wasm32-wasip3

- name: Clippy
run: cargo clippy --all
run: |
cargo clippy --workspace --exclude test-programs --target wasm32-wasip2
cargo clippy --workspace --exclude test-programs --target wasm32-wasip3
cargo clippy -p test-programs

verify-publish:
name: Verify publish
Expand All @@ -92,6 +105,8 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: ./.github/actions/install-rust
with:
toolchain: nightly
- run: rustc ci/publish.rs
# Make sure we can bump version numbers for the next release
- run: ./publish bump
Expand Down
8 changes: 8 additions & 0 deletions ci/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ fn publish(krate: &Crate) -> bool {
.arg("publish")
.current_dir(krate.manifest.parent().unwrap())
.arg("--no-verify")
.arg("--target")
.arg("wasm32-wasip2")
.arg("--target")
.arg("wasm32-wasip3")
.status()
.expect("failed to run cargo");
if !status.success() {
Expand Down Expand Up @@ -362,6 +366,10 @@ fn verify(crates: &[Crate]) {
let mut cmd = Command::new("cargo");
cmd.arg("package")
.arg("--allow-dirty")
.arg("--target")
.arg("wasm32-wasip2")
.arg("--target")
.arg("wasm32-wasip3")
.arg("--manifest-path")
.arg(&krate.manifest)
.env("CARGO_TARGET_DIR", "./target");
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pub mod io;
pub mod iter;
#[cfg(all(target_os = "wasi", target_env = "p2"))]
pub mod net;
#[cfg(target_os = "wasi")]
pub mod rand;
pub mod runtime;
#[cfg(all(target_os = "wasi", target_env = "p2"))]
Expand Down
Loading