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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user