Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Continuous Integration
#
# Runs quality gates on every push to main and every pull request targeting main.
# All gates must pass before merging.
#
# Gates (per AGENTS.md §7):
# typecheck → tsc --noEmit (zero errors)
# lint → eslint --max-warnings 0 (zero warnings)
# format → prettier --check (all files formatted)
# test → vitest run (all tests pass)
# coverage → vitest run --coverage (≥90% branch/fn/line/stmt)
# mutation → stryker run (≥80% score)
# e2e → playwright test (macOS + Windows)
#
# Standard: https://github.com/petry-projects/.github/blob/main/standards/ci-standards.md#required-workflows
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions: {}

jobs:
# ── Static analysis ────────────────────────────────────────────────────────
typecheck:
name: Type check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Type check
run: npm run typecheck
Comment on lines +41 to +45

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm ci / npm run ... assume a Node project at repository root, but there is no package.json (and no src/ directory) in this repo, so every job will fail immediately. Either add the missing Node project scaffold (package.json + lockfile/scripts) or update this workflow to run commands from the actual app directory / guard execution when the Node project is not present (e.g., detect package.json path and set working-directory).

Copilot uses AI. Check for mistakes.

lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

format:
name: Format
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npx prettier --check .

# ── Tests & coverage ───────────────────────────────────────────────────────
test:
name: Test & Coverage
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests with coverage
run: npm test -- --coverage

Comment on lines +102 to +104

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/AGENTS.md call out explicit coverage thresholds (≥90% across branch/fn/line/stmt), but the workflow only runs npm test -- --coverage and the repo currently has no Vitest config (vitest.config.*) to enforce thresholds. Add Vitest coverage threshold configuration (or an explicit CI check that reads the coverage summary and fails below 90%) so this gate is actually enforced.

Copilot uses AI. Check for mistakes.
# ── Mutation testing ───────────────────────────────────────────────────────
mutation:
name: Mutation Testing
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run mutation tests
run: npm run test:mutate
Comment on lines +122 to +123

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/AGENTS.md call out an 80% minimum mutation score, but this workflow just runs npm run test:mutate and the repo currently has no Stryker config (stryker.config.*) to set/verify thresholds. Ensure Stryker is configured to fail the run when the score is below 80% (e.g., via thresholds in config) so the CI gate is actually enforced.

Copilot uses AI. Check for mistakes.

# ── End-to-end tests ───────────────────────────────────────────────────────
e2e:
name: E2E (${{ matrix.os }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx playwright install --with-deps is intended for Linux dependency installation; on macos-latest / windows-latest this can fail or be a no-op depending on the Playwright version. Consider removing --with-deps for this job, or conditionally using it only on Linux runners (and use plain npx playwright install for macOS/Windows).

Suggested change
run: npx playwright install --with-deps
run: npx playwright install

Copilot uses AI. Check for mistakes.

- name: Run E2E tests
run: npm run test:e2e
Loading