Port more dialect tests in #12
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: | |
| branches: [main] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| components: rustfmt | |
| - name: Check Rust format | |
| run: cargo fmt --check | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: ts/package-lock.json | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| - name: Build WASM | |
| run: wasm-pack build --target nodejs --out-dir ts/wasm | |
| - name: Install npm dependencies | |
| working-directory: ts | |
| run: npm ci | |
| - name: Lint TypeScript | |
| working-directory: ts | |
| run: npm run lint | |
| - name: Build TypeScript | |
| working-directory: ts | |
| run: npm run build:ts | |
| - name: Run tests | |
| working-directory: ts | |
| run: npm test | |
| publish: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| - name: Build | |
| run: | | |
| wasm-pack build --target nodejs --out-dir ts/wasm | |
| cd ts && npm ci && npm run build:ts | |
| - name: Publish to npm | |
| working-directory: ts | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |