-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vendor install-rust CI action from Wasmtime (#1901)
* Update CI workflows imported from Wasmtime Mostly to update the auto-installation of `wasm32-wasi` to `wasm32-wasip1` now that it's been renamed on nightly. * Try the 27 release branch * Try the main branch * Vendor the install-rust action in this repo Update it to work for wasm-tools as well
- Loading branch information
1 parent
3e0dda0
commit c430ce5
Showing
2 changed files
with
61 additions
and
18 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,43 @@ | ||
name: 'Install Rust toolchain' | ||
description: 'Install a rust toolchain' | ||
|
||
inputs: | ||
toolchain: | ||
description: 'Default toolchan to install' | ||
required: false | ||
default: 'stable' | ||
|
||
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/') | ||
if [ "${{ inputs.toolchain }}" = "msrv" ]; then | ||
echo "version=1.$msrv.0" >> "$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" |
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