Adds automated checks that were previously only run manually and locally, closing the last remaining gap before dev can be merged into main with confidence. Runs on every push and pull request targeting dev or main: - lint (eslint) - format check (prettier --check) - changeset presence check (non-blocking for now, see comment in workflow file) - unit tests (vitest) - component/browser tests (vitest + playwright, via the existing Docker test setup) Fixes: #10
73 lines
1.5 KiB
YAML
73 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [dev, main]
|
|
pull_request:
|
|
branches: [dev, main]
|
|
|
|
jobs:
|
|
lint-and-format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
|
|
- run: corepack enable
|
|
- run: corepack prepare pnpm@11.11.0 --activate
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: pnpm lint
|
|
|
|
- name: Check formatting
|
|
run: pnpm format:check
|
|
|
|
changeset-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
|
|
- run: corepack enable
|
|
- run: corepack prepare pnpm@11.11.0 --activate
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
- name: Verify changeset exists
|
|
continue-on-error: true
|
|
run: pnpm changeset status --since=origin/dev
|
|
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
|
|
- run: corepack enable
|
|
- run: corepack prepare pnpm@11.11.0 --activate
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run unit tests
|
|
run: pnpm test:unit
|
|
|
|
component-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Run component tests (Docker)
|
|
run: pnpm test:component |