Found by actually running ci.yml on the real Gitea instance: the go job failed at go vet with "wayland-client-core.h: No such file or directory" building go-gl/glfw (a Fyne dependency), which compiles in both its X11 and Wayland backends by default. libgl1-mesa-dev + xorg-dev alone aren't enough; added libwayland-dev and libxkbcommon-dev to both ci.yml and release.yml's linux packages list. I'd only verified cmd/gui's build on macOS and via the Windows mingw-w64 cross-compile - never on an actual Linux machine, so this gap wasn't visible until the real CI run hit it. sqlc, web and docker all passed on that same run (confirmed from the job logs, not just the status column). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
103 lines
2.5 KiB
YAML
103 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
|
|
jobs:
|
|
go:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
# cmd/gui (Fyne) uses cgo and links against the system's OpenGL/X11
|
|
# *and* Wayland libraries (go-gl/glfw compiles in both backends), so
|
|
# building or testing ./... needs all of these present even though
|
|
# the GUI itself never opens a window in CI. Found by a real failure
|
|
# here, not guessed: go vet failed with "wayland-client-core.h: No
|
|
# such file or directory" when only libgl1-mesa-dev/xorg-dev were
|
|
# installed.
|
|
- name: Install system dependencies for the Fyne GUI build
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgl1-mesa-dev xorg-dev libwayland-dev libxkbcommon-dev
|
|
|
|
- name: gofmt
|
|
run: |
|
|
fmt_out="$(gofmt -l .)"
|
|
if [ -n "$fmt_out" ]; then
|
|
echo "The following files are not gofmt'd:"
|
|
echo "$fmt_out"
|
|
exit 1
|
|
fi
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
- name: go build
|
|
run: go build ./...
|
|
|
|
- name: go test
|
|
run: go test ./...
|
|
|
|
- name: go mod tidy (no diff expected)
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code -- go.mod go.sum
|
|
|
|
sqlc:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: sqlc-dev/setup-sqlc@v4
|
|
with:
|
|
sqlc-version: "1.31.1"
|
|
|
|
- name: sqlc diff (generated code must match the schema/queries)
|
|
run: sqlc diff
|
|
|
|
web:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: web
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Test
|
|
run: npm test
|
|
|
|
# Builds the image on every push as a health check (catches a broken
|
|
# Dockerfile immediately); doesn't push anywhere. release.yml does the
|
|
# same build and pushes it.
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: false
|