build(deps): update dependency cargo:cargo-rail to v0.22.1 (#365) #2
This file contains hidden or 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
| name: js | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| MISE_EXPERIMENTAL: 1 | |
| permissions: {} | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| js: ${{ steps.filter.outputs.js }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| js: | |
| - 'crates/eryx-core/**' | |
| - 'crates/eryx/**' | |
| - 'crates/eryx-wasm-runtime/**' | |
| - 'crates/eryx-runtime/**' | |
| - 'js/**' | |
| - 'Cargo.lock' | |
| - 'Cargo.toml' | |
| - '.github/workflows/js.yml' | |
| build: | |
| name: JavaScript bindings | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: >- | |
| github.event_name == 'push' | |
| || needs.changes.outputs.js == 'true' | |
| steps: | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| - uses: actions/checkout@v7 | |
| - name: Cache WASM runtime | |
| id: wasm-cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| crates/eryx-runtime/runtime.wasm | |
| key: wasm-runtime-v3-${{ hashFiles('crates/eryx-wasm-runtime/src/**', 'crates/eryx-wasm-runtime/clock_stubs.c', 'crates/eryx-wasm-runtime/Cargo.toml', 'crates/eryx-runtime/build.rs', 'crates/eryx-runtime/wit/runtime.wit', 'crates/eryx-runtime/libs/*.zst', 'Cargo.lock') }} | |
| - name: Touch cached WASM | |
| if: steps.wasm-cache.outputs.cache-hit == 'true' | |
| run: | | |
| # Touch runtime.wasm so mise considers wasm-build task current | |
| touch crates/eryx-runtime/runtime.wasm | |
| - name: Configure Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: ./.github/actions/setup-rust | |
| - name: Install nightly toolchain | |
| run: rustup toolchain install nightly --component rust-src | |
| - name: Force rebuild (cache may have stale timestamps) | |
| if: steps.wasm-cache.outputs.cache-hit != 'true' | |
| run: | | |
| find crates/eryx-wasm-runtime/src -name "*.rs" -exec touch {} + | |
| find crates/eryx-runtime/wit -name "*.wit" -exec touch {} + | |
| - name: Build and test JavaScript bindings | |
| working-directory: js | |
| run: mise run test |