Verify Bun and Cloudflare Workers support in CI and document supporte… #6
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x, 22.x, 24.x] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build and test | |
| run: npm test | |
| # Verifies the built library on non-Node runtimes: Bun and the Cloudflare | |
| # Workers runtime (workerd, via Miniflare). | |
| runtimes: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| - name: Use Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Smoke test on Node.js | |
| run: npm run test:smoke | |
| - name: Smoke test on Bun | |
| run: bun test/smoke.mjs | |
| - name: Smoke test on Cloudflare Workers (workerd) | |
| run: npm run test:workers |