From 782744f35c39c52b242dc43be93ddd29ae2adf68 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 9 Jun 2026 22:50:51 +0200 Subject: [PATCH] ci: build and lint the wasm32-wasip1 target Add a job that installs the wasm32-wasip1 target plus the WASI SDK (so the bundled C in onig_sys can be cross-compiled) and runs cargo build and clippy -D warnings, so non-Unix compilation can't regress. --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e27b404..d528110 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,29 @@ jobs: - run: | cargo clippy --all-targets -- -D warnings + wasm: + name: cargo build (wasm32-wasip1) + runs-on: ubuntu-latest + env: + WASI_SDK_VERSION: "33" + WASI_SDK_PATH: ${{ github.workspace }}/wasi-sdk + # onig_sys compiles bundled C, so it needs a C compiler with a WASI + # sysroot to cross-compile to wasm. + CC_wasm32_wasip1: ${{ github.workspace }}/wasi-sdk/bin/clang + AR_wasm32_wasip1: ${{ github.workspace }}/wasi-sdk/bin/llvm-ar + steps: + - uses: actions/checkout@v6 + - name: Install wasm target + run: rustup target add wasm32-wasip1 + - name: Install WASI SDK + run: | + curl -sSfL "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz" | tar xz + mv "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux" "${WASI_SDK_PATH}" + - name: Build + run: cargo build --target wasm32-wasip1 + - name: Clippy + run: cargo clippy --target wasm32-wasip1 -- -D warnings + grcov: name: Code coverage runs-on: ${{ matrix.os }}