Repository navigation
Add Serial tests + strengthen the test harness #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: CI | |
| # Runs the unit tests and verifies that the committed dist/ bundles are in sync | |
| # with src/. Because dist/ is what CDN consumers load (jsDelivr serves it straight | |
| # from this repo), a stale dist/ would silently ship old code — this job fails the | |
| # build if someone edits src/ without rebuilding. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Rebuild dist/ | |
| run: npm run build | |
| - name: Verify dist/ is in sync with src/ | |
| run: | | |
| if ! git diff --exit-code -- dist/; then | |
| echo "::error::dist/ is out of date with src/. Run 'npm run build' and commit the regenerated dist/ files (bundles + .d.ts)." | |
| exit 1 | |
| fi |