Skip to content

Commit 84717c9

Browse files
aksOpsclaude
andcommitted
ci: build UI bundle before Go in release + add PR ci workflow
The release pipeline has been broken since 2026-04-22 (5 consecutive failed runs) because internal/serve/dist/ is gitignored and the workflow never built it before invoking go test / go build. //go:embed all:dist errors out when the directory is empty. release.yml: insert pnpm + Node setup and `make ui` between Set up Go and Run tests. The populated internal/serve/dist/ is now picked up by both the test step and the cross-compiled binary builds, and is naturally included in the air-gapped src tarball (existing tar excludes top-level dist/ only). ci.yml: new workflow gating PRs and non-main pushes on the same UI build + go build/vet/test + ui typecheck + vitest. Mirrors the release pipeline's prerequisites so a broken main is caught before merge. e2e and audit steps live in `make regression` for now — promotable to merge gates later. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1038b7a commit 84717c9

2 files changed

Lines changed: 94 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# PR + non-main-push gate. Runs the same UI build + Go build + tests
2+
# the release pipeline depends on, so a broken main is caught before
3+
# merge instead of after.
4+
#
5+
# Scope intentionally narrower than `make regression`: e2e (Playwright
6+
# browser install + browser run), `pnpm audit`, and `govulncheck` are
7+
# heavier and currently run via `make regression` locally — adding them
8+
# here is a follow-up if/when they prove necessary as merge gates.
9+
10+
name: CI
11+
12+
on:
13+
pull_request:
14+
push:
15+
branches-ignore:
16+
# main is covered by release.yml; skipping here avoids running the
17+
# same checks twice on every merge.
18+
- main
19+
20+
permissions:
21+
contents: read
22+
23+
concurrency:
24+
group: ci-${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
build-and-test:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Go
35+
uses: actions/setup-go@v5
36+
with:
37+
go-version-file: go.mod
38+
39+
- name: Set up pnpm
40+
uses: pnpm/action-setup@v4
41+
with:
42+
version: 10.33.0
43+
44+
- name: Set up Node
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 22
48+
cache: pnpm
49+
cache-dependency-path: ui/pnpm-lock.yaml
50+
51+
- name: Build UI bundle
52+
# Required before any Go invocation: //go:embed all:dist in
53+
# internal/serve/assets.go errors out if internal/serve/dist/
54+
# is empty.
55+
run: make ui
56+
57+
- name: Go vet
58+
run: go vet -tags sqlite_fts5 ./...
59+
60+
- name: Go build
61+
run: go build -tags sqlite_fts5 ./...
62+
63+
- name: Go test
64+
run: go test -tags sqlite_fts5 ./...
65+
66+
- name: UI typecheck
67+
run: pnpm -C ui exec tsc --noEmit
68+
69+
- name: UI test
70+
run: pnpm -C ui test

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,30 @@ jobs:
4040
# and the release build succeed against the source tree.
4141
go-version-file: go.mod
4242

43+
- name: Set up pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
# Pinned to ui/package.json packageManager so a bumped lockfile
47+
# doesn't desync from the toolchain CI runs the build with.
48+
version: 10.33.0
49+
50+
- name: Set up Node
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 22
54+
cache: pnpm
55+
cache-dependency-path: ui/pnpm-lock.yaml
56+
57+
- name: Build UI bundle
58+
# Populates internal/serve/dist/ from ui/dist/ via rsync so the
59+
# `//go:embed all:dist` directive in internal/serve/assets.go has
60+
# a non-empty match. Without this, both `go test ./...` and the
61+
# cross-compiled binary builds below fail at compile time. The
62+
# populated dist is naturally bundled into the air-gapped source
63+
# tarball later (the tar excludes top-level ./dist staging only,
64+
# not internal/serve/dist).
65+
run: make ui
66+
4367
- name: Run tests
4468
run: go test ./...
4569

0 commit comments

Comments
 (0)