From 0ee4dfcf4268200acbac832da39ad50239195a47 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 22 Apr 2026 12:59:07 -0400 Subject: [PATCH] ci: install Node + build web before Go steps Go's //go:embed needs web/build/ to exist at compile time. CI now runs 'npm ci && npm run build && npm test' ahead of the Go steps so the embed directive sees real, freshly-built assets. Co-Authored-By: Claude Opus 4.7 --- .forgejo/workflows/test.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index fb057905..c26b7d74 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -1,7 +1,7 @@ name: test -# Lint + short unit tests only. Integration tests needing Postgres/ffmpeg -# run locally via docker-compose; they should guard with testing.Short(). +# Lint + short unit tests. Integration tests needing Postgres/ffmpeg run +# locally via docker-compose; they should guard with testing.Short(). on: push: @@ -17,6 +17,25 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + cache-dependency-path: web/package-lock.json + + - name: Install web deps + working-directory: web + run: npm ci + + - name: Web build (populates web/build/ for go:embed) + working-directory: web + run: npm run build + + - name: Web test (vitest) + working-directory: web + run: npm test + - name: Detect Go project id: gomod shell: bash