Skip to content

Commit

Permalink
Updates for latest cargo-component version
Browse files Browse the repository at this point in the history
v0.14.0 of cargo-component requires the `wasm32-wasip1` target, which is only available in Rust versions 1.78.0 and later.

This updates the `RUST_VERSION`, the target name, as well as pins the `CARGO_COMPONENT_VERSION` to hopefully avoid an issue like this in the future.

Signed-off-by: Ben Brandt <[email protected]>
  • Loading branch information
benbrandt committed Jul 11, 2024
1 parent 74f0ee9 commit dbbefe9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.76
CARGO_COMPONENT_VERSION: 0.14.0
RUST_VERSION: 1.79
WASI_SDK_VERSION: "22.0"
WASI_SDK_RELEASE: wasi-sdk-22

Expand All @@ -34,11 +35,12 @@ jobs:
rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt
rustup default ${{ env.RUST_VERSION }}
- name: Install Wasm Rust target
run: rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
run: rustup target add wasm32-wasip1 && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
- name: Install cargo-component
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-component
version: ${{ env.CARGO_COMPONENT_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-full-${{ hashFiles('./Cargo.lock') }}"
Expand All @@ -53,19 +55,17 @@ jobs:
- uses: actions/checkout@v4

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

- name: Cargo Clippy
run:
cargo clippy --workspace --all-targets --all-features -- -D warnings
run: cargo clippy --workspace --all-targets --all-features -- -D warnings

build-rust:
name: Build Plugin
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
config:
- { os: ubuntu-latest, platform: "linux" }
- { os: macos-latest, platform: "macos" }
steps:
Expand All @@ -75,11 +75,12 @@ jobs:
rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt --no-self-update
rustup default ${{ env.RUST_VERSION }}
- name: "Install Wasm Rust target"
run: rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
run: rustup target add wasm32-wasip1 && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
- name: Install cargo-component
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-component
version: ${{ env.CARGO_COMPONENT_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-full-${{ hashFiles('./Cargo.lock') }}"
Expand Down Expand Up @@ -107,11 +108,12 @@ jobs:
rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt --no-self-update
rustup default ${{ env.RUST_VERSION }}
- name: "Install Wasm Rust target"
run: rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
run: rustup target add wasm32-wasip1 && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
- name: Install cargo-component
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-component
version: ${{ env.CARGO_COMPONENT_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-full-${{ hashFiles('./Cargo.lock') }}"
Expand Down

0 comments on commit dbbefe9

Please sign in to comment.