Skip to content

feat(ci): optional build step before the Go checks - #25

Merged
ngoyal16 merged 1 commit into
mainfrom
feat/go-pre-build-step
Nov 23, 2026
Merged

ngoyal16 merged 1 commit into
mainfrom
feat/go-pre-build-step

Conversation

@ngoyal16

Copy link
Copy Markdown
Contributor

Why

code-review-console is stopping committing its built admin UI (divmora/code-review-console#137). The Go binary embeds the UI with go:embed, and the admin tests serve it, so the Go checks need the UI built first. Neither go-ci.yml nor docker-publish.yml's quality job had a way to run anything before lint and tests.

Changes

Three optional inputs, added to both go-ci.yml and docker-publish.yml (quality job):

Input Default Effect
node-version '' sets up Node.js (actions/setup-node@v4) when set
node-cache-dependency-path '' lockfile for the npm cache; empty means no cache
pre-build-command '' run with bash -euo pipefail after Go and Node are set up, before lint and tests
  • With everything empty, both steps are skipped, so every other repo is unchanged.
  • The command is passed through an environment variable, not interpolated into the script.
  • AGENTS.md documents the inputs.

Caller (console)

uses: divmora/.github/.github/workflows/go-ci.yml@main
with:
  go-version: '1.27'
  node-version: '24'
  node-cache-dependency-path: web/package-lock.json
  pre-build-command: make web

Merge this first. Console #137 will then use these inputs and drop its own CI job.

🤖 Generated with Claude Code

go-ci.yml and docker-publish.yml's quality job take node-version,
node-cache-dependency-path and pre-build-command. They run after Go is
set up, before lint and tests, for Go builds that need files that aren't
committed, such as a web UI embedded with go:embed (code-review-console
stops committing its built admin UI). All default to empty, so other
repos are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngoyal16 added a commit to divmora/code-review-console that referenced this pull request Nov 23, 2026
Back to divmora/.github's go-ci.yml and docker-publish.yml, which now
take node-version, node-cache-dependency-path and pre-build-command
(divmora/.github#25): make web runs before lint and tests in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ngoyal16
ngoyal16 merged commit b7be479 into main Nov 23, 2026
2 checks passed
@ngoyal16
ngoyal16 deleted the feat/go-pre-build-step branch November 23, 2026 15:33
ngoyal16 added a commit to divmora/code-review-console that referenced this pull request Nov 23, 2026
…d releases (#137)

* build: stop committing the admin UI bundle; build it in CI, Docker and releases

The built admin UI (internal/admin/ui, about 600 KB) was committed so a
plain go build had it, which made nearly every UI change conflict with
the next. It is now ignored, except internal/admin/ui/.keep (restored by
web/public/.keep on each build) so go:embed still compiles.

- Dockerfile: a node:24 stage builds the UI, copied in before go build.
- GoReleaser: make web in the before hooks.
- CI: the console's own Go job (like the org go-ci workflow, same pinned
  golangci-lint) builds the UI first; the stale-bundle check is gone.
- Makefile: build, test, test-db and lint build the UI when it's missing.
- A binary built without the UI starts and serves a page saying how to
  build it, instead of panicking; the admin tests say to run make web.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: drop the Docker workflow's duplicate Go checks

The org docker-publish workflow's Go quality job ran lint and tests
without building the admin UI, which is no longer committed, so the
admin tests failed there. ci.yml runs the same lint and tests with the
UI built on every PR and push; the image build runs when the quality
job is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: use the shared workflows' pre-build step instead of an own job

Back to divmora/.github's go-ci.yml and docker-publish.yml, which now
take node-version, node-cache-dependency-path and pre-build-command
(divmora/.github#25): make web runs before lint and tests in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant