Skip to content

fix(ci): build frontend before Go CI jobs #3

fix(ci): build frontend before Go CI jobs

fix(ci): build frontend before Go CI jobs #3

Workflow file for this run

name: Go CI
permissions:
contents: read
on:
push:
branches:
- main
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- 'frontend/**'
- '.github/workflows/go-ci.yaml'
pull_request:
branches:
- main
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- 'frontend/**'
- '.github/workflows/go-ci.yaml'
workflow_dispatch:
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Upload frontend artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: internal/server/frontend/
retention-days: 1
ci:
needs: build-frontend
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['stable', 'oldstable']
steps:
- uses: actions/checkout@v4
- name: Download frontend artifacts
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: internal/server/frontend/
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...