-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add required ci.yml workflow #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||||||
|
|
||||||
| 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
|
||||||
| # ── 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
|
||||||
|
|
||||||
| # ── 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 | ||||||
|
||||||
| run: npx playwright install --with-deps | |
| run: npx playwright install |
There was a problem hiding this comment.
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 nopackage.json(and nosrc/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 setworking-directory).