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
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# PR + non-main-push gate. Runs the same UI build + Go build + tests
# the release pipeline depends on, so a broken main is caught before
# merge instead of after.
#
# Scope intentionally narrower than `make regression`: e2e (Playwright
# browser install + browser run), `pnpm audit`, and `govulncheck` are
# heavier and currently run via `make regression` locally — adding them
# here is a follow-up if/when they prove necessary as merge gates.

name: CI

on:
pull_request:
push:
branches-ignore:
# main is covered by release.yml; skipping here avoids running the
# same checks twice on every merge.
- main

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Set up pnpm
uses: pnpm/action-setup@v4

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'CI' step
Uses Step
uses 'pnpm/action-setup' with ref 'v4', not a pinned commit hash
with:
version: 10.33.0

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml

- name: Build UI bundle
# Required before any Go invocation: //go:embed all:dist in
# internal/serve/assets.go errors out if internal/serve/dist/
# is empty.
run: make ui

- name: Go vet
run: go vet -tags sqlite_fts5 ./...

- name: Go build
run: go build -tags sqlite_fts5 ./...

- name: Go test
run: go test -tags sqlite_fts5 ./...

- name: UI typecheck
run: pnpm -C ui exec tsc --noEmit

- name: UI test
run: pnpm -C ui test
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,30 @@
# and the release build succeed against the source tree.
go-version-file: go.mod

- name: Set up pnpm
uses: pnpm/action-setup@v4

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Release' step
Uses Step
uses 'pnpm/action-setup' with ref 'v4', not a pinned commit hash
with:
# Pinned to ui/package.json packageManager so a bumped lockfile
# doesn't desync from the toolchain CI runs the build with.
version: 10.33.0

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml

- name: Build UI bundle
# Populates internal/serve/dist/ from ui/dist/ via rsync so the
# `//go:embed all:dist` directive in internal/serve/assets.go has
# a non-empty match. Without this, both `go test ./...` and the
# cross-compiled binary builds below fail at compile time. The
# populated dist is naturally bundled into the air-gapped source
# tarball later (the tar excludes top-level ./dist staging only,
# not internal/serve/dist).
run: make ui

- name: Run tests
run: go test ./...

Expand Down
Loading