From 49f882b934c85d95dd1441710d62802f4a77945c Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 7 Feb 2025 15:39:17 +0800 Subject: [PATCH 1/3] chore: ensure wasm compilation --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8078721..bcb7e79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,26 @@ jobs: - run: | cargo nextest run --all-features --no-tests=pass + wasm-check: + name: Check WASM compilation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_VERSION }} + targets: wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v2 + - uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Check WASM build (no-modules) + run: wasm-pack build --out-dir pkg-no-modules --release --target no-modules + - name: Check WASM build (web) + run: wasm-pack build --out-dir pkg-web --release --target web + clippy: runs-on: ubuntu-latest steps: From 5717ed60ba541c1064810c98c8a9e672c67d2ecf Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 7 Feb 2025 15:46:50 +0800 Subject: [PATCH 2/3] just build wasm --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcb7e79..c4361e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - run: | cargo nextest run --all-features --no-tests=pass - wasm-check: + ensure-wasm: name: Check WASM compilation runs-on: ubuntu-latest steps: @@ -43,12 +43,8 @@ jobs: - uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Check WASM build (no-modules) - run: wasm-pack build --out-dir pkg-no-modules --release --target no-modules - - name: Check WASM build (web) - run: wasm-pack build --out-dir pkg-web --release --target web + - name: Compile WASM + run: cargo build --release --target wasm32-unknown-unknown clippy: runs-on: ubuntu-latest From ee755f4c0dc601b047790f17a1feb115d74d259c Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 7 Feb 2025 16:07:05 +0800 Subject: [PATCH 3/3] install target --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4361e6..dc1b4bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,8 @@ jobs: - uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install wasm32 target + run: rustup target add wasm32-unknown-unknown - name: Compile WASM run: cargo build --release --target wasm32-unknown-unknown