Run go test inside Docker build instead of separate docker run step
Some checks failed
Deploy to NAS / deploy (push) Failing after 3m0s
Some checks failed
Deploy to NAS / deploy (push) Failing after 3m0s
Bind-mounted source causes Go module resolution issues in the runner container. Tests now run as a Dockerfile layer (after go mod download, before SPA inject + go build) — no bind mount, no extra step needed. A failed test aborts the build and the deploy never happens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ WORKDIR /app
|
||||
COPY backend/go.mod backend/go.sum ./
|
||||
RUN go mod download
|
||||
COPY backend/ ./
|
||||
RUN go test ./...
|
||||
# Inject built SPA into embed path
|
||||
COPY --from=webapp-builder /webapp/dist ./internal/api/webapp/
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /server ./cmd/server
|
||||
|
||||
Reference in New Issue
Block a user