fix(ui): pin TypeScript inside typescript-eslint's peer range, guard the UI build in CI #518
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| name: build · vet · test | |
| runs-on: ubuntu-latest | |
| env: | |
| CGO_ENABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: go build | |
| run: go build ./... | |
| - name: go vet | |
| run: go vet ./... | |
| - name: go test (race) | |
| run: go test -race -timeout 180s ./... | |
| - name: loadsim build tag compiles | |
| run: go build -tags loadtest ./test/loadsim/... | |
| # The seven-day release gate (#202). CI compiles the orchestrator and | |
| # runs its unit tests — parsers, projection fit, threshold logic, report | |
| # renderer. It must NOT run the protocol: that is four to five hours of | |
| # sustained load and a kill -9, and it does not belong on a shared runner. | |
| - name: prefill build tag compiles | |
| run: go build -tags prefill ./test/aggprefill/... | |
| - name: gate build tag compiles | |
| run: go build -tags gate ./test/gate/... | |
| - name: gate unit tests | |
| run: go test -tags gate -race -timeout 60s ./test/gate/... | |
| ui-build: | |
| name: ui · typecheck · build · test | |
| runs-on: ubuntu-latest | |
| # main is source-only: the SPA is built at tag time and embedded via | |
| # //go:embed. Nothing else in CI installs ui/ dependencies, so a frontend | |
| # dependency tree that cannot resolve — or code that cannot typecheck — | |
| # stays invisible until a release tag fails. That happened: a TypeScript | |
| # bump crossed typescript-eslint's peer bound and broke `npm ci` on main | |
| # while every Go job stayed green. This job is the guard. | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' # matches the release workflow's build environment | |
| cache: npm | |
| cache-dependency-path: ui/package-lock.json | |
| # `npm ci` fails outright on an unsatisfiable peer graph, which is the | |
| # failure mode this job exists to catch. --ignore-scripts matches the | |
| # release path (scripts/release.sh, release.yml). | |
| - name: install (exact lockfile, no lifecycle scripts) | |
| run: npm ci --ignore-scripts | |
| working-directory: ui | |
| # `npm run build` is `tsc -b && vite build`: the typecheck catches an API | |
| # that a dependency major removed, the bundle catches a broken import. | |
| - name: typecheck and build | |
| run: npm run build | |
| working-directory: ui | |
| - name: the embedded SPA entrypoint exists | |
| run: test -f internal/ui/dist/index.html | |
| - name: unit tests | |
| run: npx --no-install vitest run | |
| working-directory: ui |