Repository navigation
ci: add npm publish-on-release workflow (Trusted Publishing/OIDC) #10
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: | |
| jobs: | |
| typescript: | |
| name: TypeScript (Node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: ["20", "22"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - run: npm ci | |
| working-directory: packages/ts | |
| - run: npm run build | |
| working-directory: packages/ts | |
| - run: npm test | |
| working-directory: packages/ts | |
| rust: | |
| name: Rust | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - run: cargo fmt --all -- --check | |
| working-directory: crates/validator | |
| - run: cargo clippy --all-targets -- -D warnings | |
| working-directory: crates/validator | |
| - run: cargo test | |
| working-directory: crates/validator | |
| wasm: | |
| name: WebAssembly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| # Build the TS surface first: the Wasm parity test imports @jsonstat-validator/ts. | |
| - run: npm ci | |
| - run: npm run build -w @jsonstat-validator/ts | |
| # `npm test` runs `pretest` (wasm-pack -t web -> packages/wasm/pkg, with the getrandom cfg set | |
| # in tools/build.mjs) then the TS<->Wasm corpus parity test (packages/wasm/test/parity.test.ts). | |
| - run: npm test -w @jsonstat-validator/wasm |