ci: run tests, lint, format, and lockfile checks on PRs #2
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: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check package-lock.json is up to date | |
| run: | | |
| npm install | |
| if ! git diff --exit-code -- package-lock.json; then | |
| echo "::error file=package-lock.json::package-lock.json is out of sync with package.json. Run 'npm install' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Lint | |
| run: npm run lint | |
| - name: Format check | |
| run: npm run format | |
| - name: Type check | |
| run: npm run build:check | |
| - name: Unit tests | |
| run: npm test | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Browser tests | |
| run: npm run test:browser |