Files
Reims-Go/.github/workflows/ci.yml
T
千川白浪 c91f5901a7 chore(debug,ci): add .debug workspace tooling and hygiene checks
Ignore .debug/ locally and add scripts/debug/ helpers (tmp, work, worktree, check, and tests) to enforce workspace hygiene. Run the hygiene check and self-test in CI, and document the .debug/ contract in AGENTS.md and docs/architecture.md.
2026-11-29 21:15:14 -07:00

68 lines
2.1 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
verify:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Verify CHANGELOG.md matches current version
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$verFile = Get-Content -Raw -LiteralPath 'internal/version/version.go'
if ($verFile -notmatch 'var\s+Version\s*=\s*"(v[^"]+)"') {
throw 'Could not parse Version from internal/version/version.go'
}
$ver = $Matches[1]
$tmp = Join-Path $env:RUNNER_TEMP "release-notes-$ver.md"
& ./scripts/build-release-notes.ps1 -Tag $ver -OutFile $tmp
Write-Host "PASS CHANGELOG.md contains valid release notes for $ver ($((Get-Item -LiteralPath $tmp).Length) bytes)"
- name: Frontend build
shell: pwsh
run: |
pnpm --dir frontend install --frozen-lockfile
pnpm --dir frontend build
- name: Debug workspace hygiene check & self-test
shell: pwsh
run: |
node scripts/debug/check.mjs
node --test scripts/debug/debug.test.mjs
- name: Go test & vet
shell: pwsh
run: |
go test ./...
go vet ./...
- name: Build reims-go.exe (window + command-line mode)
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path build/bin | Out-Null
go build -trimpath -tags desktop,production -ldflags "-H windowsgui" -o build/bin/reims-go.exe .
# Command-line mode must still answer through a pipe from the GUI-subsystem build.
$out = & build/bin/reims-go.exe version | Out-String
if ($LASTEXITCODE -ne 0 -or $out -notmatch '^reims-go ') { throw "reims-go.exe version failed: $out" }