Skip to content
Merged
Show file tree
Hide file tree
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
156 changes: 147 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ concurrency:
cancel-in-progress: true

jobs:
build-and-test:
lint:
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 15

steps:
- name: Checkout
Expand All @@ -34,25 +34,118 @@ jobs:
with:
node-version: 22.22.0
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-lint-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-lint-
${{ runner.os }}-turbo-

- name: Lint
run: pnpm run lint

typecheck:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.0
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-typecheck-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-typecheck-
${{ runner.os }}-turbo-

- name: Type check
run: pnpm run typecheck

- name: Test
run: pnpm test
unit-tests:
name: Unit tests / ${{ matrix.label }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- label: Packages
turbo-cache: unit-packages
command: pnpm exec turbo run test --filter='!@codegraphy/extension'
- label: Extension node
turbo-cache: unit-extension-node
command: pnpm exec turbo run test:node --filter=@codegraphy/extension
- label: Extension webview graph interaction and rendering
turbo-cache: unit-extension-webview-graph
command: CODEGRAPHY_VITEST_WEBVIEW_GROUP=graph pnpm exec turbo run test:webview --filter=@codegraphy/extension
- label: Extension webview app shell and plugins
turbo-cache: unit-extension-webview-app-plugins
command: CODEGRAPHY_VITEST_WEBVIEW_GROUP=appPlugins pnpm exec turbo run test:webview --filter=@codegraphy/extension
- label: Extension webview panels, search, and exports
turbo-cache: unit-extension-webview-panels-export
command: CODEGRAPHY_VITEST_WEBVIEW_GROUP=panelsExport pnpm exec turbo run test:webview --filter=@codegraphy/extension

- name: Build
run: pnpm run build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.0
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ matrix.turbo-cache }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ matrix.turbo-cache }}-
${{ runner.os }}-turbo-unit-
${{ runner.os }}-turbo-

- name: Run ${{ matrix.label }}
run: ${{ matrix.command }}

playwright:
needs: build-and-test
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 20

steps:
- name: Checkout
Expand All @@ -74,10 +167,19 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-playwright-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-playwright-
${{ runner.os }}-turbo-

- name: Install Playwright browser + system deps
run: pnpm --filter @codegraphy/extension exec playwright install --with-deps chromium

- name: Run Playwright smoke tests
- name: Playwright tests
run: pnpm run test:playwright

- name: Upload Playwright report
Expand All @@ -95,3 +197,39 @@ jobs:
name: playwright-test-results
path: test-results/
retention-days: 30

build:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.0
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-build-
${{ runner.os }}-turbo-

- name: Build
run: pnpm run build
134 changes: 134 additions & 0 deletions .github/workflows/mutation-seed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Mutation Seed

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: mutation-seed-${{ github.ref }}
cancel-in-progress: true

jobs:
discover-packages:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
packages: ${{ steps.packages.outputs.packages }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.0
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Discover mutation packages
id: packages
run: |
packages="$(pnpm exec tsx packages/quality-tools/src/cli/listMutationPackages.ts --json)"
echo "packages=${packages}" >> "$GITHUB_OUTPUT"
echo "Mutation packages: ${packages}"

seed-package:
name: Mutation seed / ${{ matrix.package }}
needs: discover-packages
runs-on: ubuntu-latest
timeout-minutes: 360
if: ${{ needs.discover-packages.outputs.packages != '[]' }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.discover-packages.outputs.packages) }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.22.0
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore package mutation seed cache
uses: actions/cache@v4
with:
path: reports/mutation/${{ matrix.package }}
key: ${{ runner.os }}-mutation-seed-${{ matrix.package }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-mutation-seed-${{ matrix.package }}-

- name: Refresh ${{ matrix.package }} mutation seed
run: pnpm run mutate -- ${{ matrix.package }}/

- name: Verify ${{ matrix.package }} incremental report exists
run: test -f "reports/mutation/${{ matrix.package }}/stryker-incremental-${{ matrix.package }}.json"

- name: Upload ${{ matrix.package }} mutation seed
uses: actions/upload-artifact@v4
with:
name: mutation-seed-${{ matrix.package }}
path: reports/mutation/${{ matrix.package }}/stryker-incremental-${{ matrix.package }}.json
if-no-files-found: error
retention-days: 14

assemble-seed:
name: Assemble mutation seed
needs: seed-package
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Download package mutation seeds
uses: actions/download-artifact@v4
with:
pattern: mutation-seed-*
path: package-seeds

- name: Assemble main mutation seed artifact
run: |
mkdir -p reports/mutation

while IFS= read -r file; do
name="$(basename "$file")"
package="${name#stryker-incremental-}"
package="${package%.json}"
mkdir -p "reports/mutation/${package}"
cp "$file" "reports/mutation/${package}/${name}"
done < <(find package-seeds -type f -name 'stryker-incremental-*.json' | sort)

printf '%s\n' "${GITHUB_SHA}" > reports/mutation/seed-sha.txt
find reports/mutation -type f | sort

- name: Upload main mutation seed
uses: actions/upload-artifact@v4
with:
name: main-mutation-seed
path: |
reports/mutation/seed-sha.txt
reports/mutation/*/stryker-incremental-*.json
if-no-files-found: error
retention-days: 14
24 changes: 1 addition & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ name: Release
on:
workflow_dispatch:
inputs:
mode:
description: Package artifacts only or publish them
required: true
default: package
type: choice
options:
- package
- publish
target:
description: Which release target to run
required: true
Expand All @@ -32,7 +24,7 @@ permissions:
contents: read

concurrency:
group: release-${{ github.workflow }}-${{ github.ref }}-${{ inputs.mode }}-${{ inputs.target }}
group: release-${{ github.workflow }}-${{ github.ref }}-${{ inputs.target }}
cancel-in-progress: false

jobs:
Expand Down Expand Up @@ -62,19 +54,5 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Release checks
run: pnpm run release:check

- name: Package selected release artifacts
run: pnpm run release:package ${{ inputs.target }}

- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: artifacts/
retention-days: 30

- name: Publish selected target
if: ${{ inputs.mode == 'publish' }}
run: pnpm run release:publish ${{ inputs.target }}
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,12 @@ If a function exceeds 8: add tests to raise coverage or refactor to reduce compl
Stryker injects small faults and verifies tests catch them. Run one module at a time — kill all survivors before moving on.

```bash
pnpm run mutate # all packages
pnpm run mutate -- plugin-godot # specific package
pnpm run mutate -- packages/plugin-godot/src/gdscript/resources.ts # specific source file
```

Bare `pnpm run mutate` is intentionally invalid. CI owns all-package mutation seed refreshes.

Thresholds: ≥90% required · ≥80% warning · <80% must fix. Report: `reports/mutation/mutation.html`.

### 5. Lint + Typecheck
Expand Down
Loading
Loading