Skip to content

Commit ec11b28

Browse files
committed
fix(ci): build web UI before tests so go:embed static assets exist
GitHub Actions cloned the repo without generated files under internal/server/static/, which broke //go:embed and caused test/lint to fail. The release job never ran because it depends on those jobs. Made-with: Cursor
1 parent 529a1d4 commit ec11b28

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
cache: npm
24+
cache-dependency-path: web/package-lock.json
25+
26+
- name: Build web UI (required for go:embed)
27+
shell: bash
28+
run: |
29+
set -e
30+
(cd web && npm ci && npm run build)
31+
rm -rf internal/server/static/assets \
32+
internal/server/static/*.html \
33+
internal/server/static/*.js \
34+
internal/server/static/*.css \
35+
internal/server/static/*.svg 2>/dev/null || true
36+
mkdir -p internal/server/static
37+
cp -r web/dist/. internal/server/static/
38+
2039
- uses: actions/setup-go@v5
2140
with:
2241
go-version: ${{ matrix.go-version }}
@@ -42,6 +61,25 @@ jobs:
4261
steps:
4362
- uses: actions/checkout@v4
4463

64+
- uses: actions/setup-node@v4
65+
with:
66+
node-version: "20"
67+
cache: npm
68+
cache-dependency-path: web/package-lock.json
69+
70+
- name: Build web UI (required for go:embed)
71+
shell: bash
72+
run: |
73+
set -e
74+
(cd web && npm ci && npm run build)
75+
rm -rf internal/server/static/assets \
76+
internal/server/static/*.html \
77+
internal/server/static/*.js \
78+
internal/server/static/*.css \
79+
internal/server/static/*.svg 2>/dev/null || true
80+
mkdir -p internal/server/static
81+
cp -r web/dist/. internal/server/static/
82+
4583
- uses: actions/setup-go@v5
4684
with:
4785
go-version: "1.22"
@@ -62,6 +100,25 @@ jobs:
62100
with:
63101
fetch-depth: 0
64102

103+
- uses: actions/setup-node@v4
104+
with:
105+
node-version: "20"
106+
cache: npm
107+
cache-dependency-path: web/package-lock.json
108+
109+
- name: Build web UI (required for go:embed)
110+
shell: bash
111+
run: |
112+
set -e
113+
(cd web && npm ci && npm run build)
114+
rm -rf internal/server/static/assets \
115+
internal/server/static/*.html \
116+
internal/server/static/*.js \
117+
internal/server/static/*.css \
118+
internal/server/static/*.svg 2>/dev/null || true
119+
mkdir -p internal/server/static
120+
cp -r web/dist/. internal/server/static/
121+
65122
- uses: actions/setup-go@v5
66123
with:
67124
go-version: "1.22"

0 commit comments

Comments
 (0)