Skip to content

Merge pull request #603 from KisaragiEffective/renovate/thiserror-2.x #188

Merge pull request #603 from KisaragiEffective/renovate/thiserror-2.x

Merge pull request #603 from KisaragiEffective/renovate/thiserror-2.x #188

Workflow file for this run

name: WebAssembly
on:
push:
branches: [ "master" ]
paths:
- package/origlang-interop/**/*
- package/origlang-interop-frontend-webserver/**/*
- .github/workflows/rust-wasm.yml
pull_request:
branches: [ "master" ]
paths:
- package/origlang-interop/**/*
- package/origlang-interop-frontend-webserver/**/*
- .github/workflows/rust-wasm.yml
env:
CARGO_TERM_COLOR: always
CI_RUST_CACHE_VERSION: v0
permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-24.04
wasmpack_target_triple: x86_64-unknown-linux-musl
wasmpack_name: wasm-pack
- os: windows-2022
wasmpack_target_triple: x86_64-pc-windows-msvc
wasmpack_name: wasm-pack.exe
# FIXME: windows does not recognize /usr/local/bin, causing build to be failed
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Rust Cache
uses: Swatinem/[email protected]
with:
prefix-key: ${{ matrix.os }}-${{ env.CI_RUSTC_VERSION }}-${{ env.CI_RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}-wasm
# If it requires full-build, wasm-pack is required to build origlang-interop.
- name: Install wasm-pack
shell: bash
run: |
# renovate: wasm-pack
git_tag="v0.11.0"
tt="${{ matrix.wasmpack_target_triple }}"
exe_name="${{ matrix.wasmpack_name }}"
d="$(mktemp)"
f="wasm-pack-${git_tag}-${tt}"
curl -L "https://github.com/rustwasm/wasm-pack/releases/download/$git_tag/${f}.tar.gz" > "$d"
e="${f}/${exe_name}"
tar xf "$d" "$e"
chmod +x "$e"
# Windows' bash does not have "/usr/local/bin"
(mv "$e" /usr/local/bin || mv "$e" /usr/bin) && ("${e}" --version || true)
rm "$d"
- name: Build origlang-interop (pre)
shell: bash
run: $GITHUB_WORKSPACE/package/origlang-interop/build.sh
- name: Build origlang-interop and origlang-interop-frontend-webserver
run: cargo build -p origlang-interop -p origlang-interop-frontend-webserver --verbose
- name: Run tests
run: cargo test -p origlang-interop -p origlang-interop-frontend-webserver --verbose