-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix tests on nightly (#1999) Ensure that `PartialOrd` and `Ord` implementations for `Alignment` are the same instead of having one be manual and one be derived. This is required to account for a small behavior change in nightly Rust. * Vendor wasmtime's install-rust action
- Loading branch information
1 parent
46cb2e8
commit 32368cd
Showing
3 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: 'Install Rust toolchain' | ||
description: 'Install a rust toolchain' | ||
|
||
inputs: | ||
toolchain: | ||
description: 'Default toolchan to install' | ||
required: false | ||
default: 'default' | ||
msrv_range: | ||
description: 'Versions later-than-latest-Rust the MSRV supports' | ||
required: false | ||
default: '2' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Rust | ||
shell: bash | ||
id: select | ||
run: | | ||
# Determine MSRV as N in `1.N.0` by looking at the `rust-version` | ||
# located in the root `Cargo.toml`. | ||
msrv=$(grep 'rust-version.*1' Cargo.toml | sed 's/.*\.\([0-9]*\)\..*/\1/') | ||
range=${{ inputs.msrv_range }} | ||
if [ "${{ inputs.toolchain }}" = "default" ]; then | ||
echo "version=1.$((msrv+range)).0" >> "$GITHUB_OUTPUT" | ||
elif [ "${{ inputs.toolchain }}" = "msrv" ]; then | ||
echo "version=1.$msrv.0" >> "$GITHUB_OUTPUT" | ||
elif [ "${{ inputs.toolchain }}" = "wasmtime-ci-pinned-nightly" ]; then | ||
echo "version=nightly-2025-01-09" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "version=${{ inputs.toolchain }}" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Install Rust | ||
shell: bash | ||
run: | | ||
rustup set profile minimal | ||
rustup update "${{ steps.select.outputs.version }}" --no-self-update | ||
rustup default "${{ steps.select.outputs.version }}" | ||
# Save disk space by avoiding incremental compilation. Also turn down | ||
# debuginfo from 2 to 0 to help save disk space. | ||
cat >> "$GITHUB_ENV" <<EOF | ||
CARGO_INCREMENTAL=0 | ||
CARGO_PROFILE_DEV_DEBUG=0 | ||
CARGO_PROFILE_TEST_DEBUG=0 | ||
EOF | ||
# Deny warnings on CI to keep our code warning-free as it lands in-tree. | ||
echo RUSTFLAGS="-D warnings" >> "$GITHUB_ENV" | ||
if [[ "${{ runner.os }}" = "macOS" ]]; then | ||
cat >> "$GITHUB_ENV" <<EOF | ||
CARGO_PROFILE_DEV_SPLIT_DEBUGINFO=unpacked | ||
CARGO_PROFILE_TEST_SPLIT_DEBUGINFO=unpacked | ||
EOF | ||
fi | ||
- name: Require semicolons in WIT | ||
shell: bash | ||
run: echo WIT_REQUIRE_SEMICOLONS=1 >> "$GITHUB_ENV" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- uses: bytecodealliance/wasmtime/.github/actions/[email protected] | ||
with: | ||
name: ${{ matrix.build }} | ||
|
@@ -63,7 +63,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- name: Test (no-hash-maps) | ||
run: cargo test --workspace --locked --features no-hash-maps | ||
|
||
|
@@ -103,7 +103,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo test --locked --all ${{ matrix.flags }} | ||
|
@@ -115,7 +115,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: cargo test --locked -p wasmparser --benches | ||
- run: cargo test --locked -p wasm-encoder --all-features | ||
- run: cargo test -p wasm-smith --features wasmparser | ||
|
@@ -133,7 +133,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: cmake -S examples -B examples/build -DCMAKE_BUILD_TYPE=Release | ||
- run: cmake --build examples/build --config Release | ||
|
||
|
@@ -144,7 +144,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
with: | ||
toolchain: 1.79.0 | ||
- run: rustup target add wasm32-wasip1 | ||
|
@@ -161,7 +161,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: rustup target add wasm32-wasip1 | ||
- run: | | ||
tag=v10.0.1 | ||
|
@@ -182,7 +182,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: rustup component add rustfmt | ||
- run: printf "\n" > playground/component/src/bindings.rs | ||
# Note that this doesn't use `cargo fmt` because that doesn't format | ||
|
@@ -197,7 +197,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
with: | ||
toolchain: nightly | ||
- run: cargo install cargo-fuzz | ||
|
@@ -208,7 +208,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: rustup target add x86_64-unknown-none | ||
- run: cargo check --benches -p wasm-smith | ||
- run: cargo check --no-default-features | ||
|
@@ -263,7 +263,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: rustup component add clippy | ||
- run: cargo clippy --workspace --exclude dl --exclude component | ||
|
||
|
@@ -274,7 +274,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: bytecodealliance/wasmtime/.github/actions/install-rust@v20.0.0 | ||
- uses: ./.github/actions/install-rust | ||
- run: rustc ci/publish.rs | ||
# Make sure we can bump version numbers for the next release | ||
- run: ./publish bump | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters