chore(deps): bump napi from 3.9.0 to 3.9.1 #116
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| # Cancel superseded runs on the same ref to save CI minutes. | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| rust: | |
| name: Rust — fmt, clippy, test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Format check | |
| run: cargo fmt --all --check | |
| - name: Clippy (warnings are errors) | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| - name: Test | |
| run: cargo test --workspace | |
| msrv: | |
| name: MSRV (Rust 1.88) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # rust-version = 1.88 is declared workspace-wide; verify the published | |
| # crates still compile on it. napi/wasm bindings are checked on stable | |
| # in their own jobs since their toolchain needs can differ. | |
| - uses: dtolnay/rust-toolchain@1.88 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo check -p mds-core -p mds-cli | |
| wasm: | |
| name: WASM — build & test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: ./.github/actions/setup-wasm | |
| - name: Build (nodejs + web targets) | |
| run: | | |
| wasm-pack build crates/mds-wasm --target nodejs --out-dir pkg | |
| wasm-pack build crates/mds-wasm --target web --out-dir pkg-web | |
| - name: Smoke-test built artifact | |
| run: | | |
| node -e " | |
| const m = require('./crates/mds-wasm/pkg/mds_wasm.js'); | |
| const r = m.compile('Hello!\n', null); | |
| console.log('smoke ok:', r.output); | |
| " | |
| - name: Test (node) | |
| run: wasm-pack test --node crates/mds-wasm | |
| - name: Test (node, release — verifies wasm-opt) | |
| run: wasm-pack test --node --release crates/mds-wasm | |
| - name: Report WASM binary sizes | |
| if: always() | |
| run: | | |
| for f in crates/mds-wasm/pkg/mds_wasm_bg.wasm crates/mds-wasm/pkg-web/mds_wasm_bg.wasm; do | |
| if [ ! -f "$f" ]; then | |
| echo "::warning::WASM file missing: $f" | |
| continue | |
| fi | |
| raw=$(wc -c < "$f" | tr -d ' ') | |
| gz=$(gzip -c "$f" | wc -c | tr -d ' ') | |
| label="${f#crates/mds-wasm/}" | |
| echo "::notice::WASM ${label}: ${raw} bytes raw, ${gz} bytes gzipped" | |
| if [ "$raw" -gt 600000 ]; then | |
| echo "::error::WASM binary exceeds 600,000 byte threshold: ${label} is ${raw} bytes" | |
| exit 1 | |
| fi | |
| done | |
| js: | |
| name: JS packages — build & test | |
| # Run on every host OS so the native addon path is exercised everywhere. | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| # Build the native addon for the host so @mdscript/mds resolves a backend. | |
| # --no-js preserves the hand-maintained crates/mds-napi/index.js loader. | |
| - name: Build native addon (host) | |
| working-directory: crates/mds-napi | |
| run: npx napi build --platform --release --no-js | |
| # Build the WASM pkg so the WASM fallback (and wasm-backend tests) work. | |
| - uses: ./.github/actions/setup-wasm | |
| - name: Build WASM (nodejs) | |
| run: wasm-pack build crates/mds-wasm --target nodejs --out-dir pkg | |
| - name: Build TS packages | |
| run: npm run build --workspaces --if-present | |
| - name: Test | |
| run: npm test --workspaces --if-present |