Files
yellowjacket/.github/workflows/ci.yml
T
logan 42d3f45d85 fix(ci): remove build-check job from CI workflow (#66)
* ci: remove build-check job from CI workflow

The cross-platform build verification is redundant in CI since the
build and release pipeline (build.yml) already performs full builds
on every release. This reduces CI runner time and costs.

* ci: restrict build-check to Linux PRs and pin R2 action to v1.4

- Build-check now only runs on pull requests (skipped on main merge)
  with only Linux/amd64 enabled; macOS and Windows are commented out
  since the Build & Publish workflow handles all platforms on release.
- Pin ryand56/r2-upload-action from floating v1 tag to v1.4 to fix
  the upload failure seen in the v1.1.0 release build.
2026-02-15 12:52:46 -06:00

215 lines
7.2 KiB
YAML

name: CI
run-name: CI — ${{ github.head_ref || github.ref_name }}
on:
push:
branches: [main]
pull_request:
branches: [main]
# Allow running manually for debugging.
workflow_dispatch:
concurrency:
group: ci-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
GO_VERSION: "1.25"
PNPM_VERSION: "10"
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
# ──────────────────────────────────────────────
# Enforce conventional commit format on PR title
# (squash-merge means PR title = release commit)
# ──────────────────────────────────────────────
commitlint:
name: Lint PR Title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
perf
refactor
revert
docs
style
chore
ci
test
build
# ──────────────────────────────────────────────
# Go: lint, vet, vulnerability check
# ──────────────────────────────────────────────
go-checks:
name: Go Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libgtk-3-dev libwebkit2gtk-4.1-dev
# The go:embed directive in main.go requires frontend/dist to exist.
# A stub suffices for vet/lint; the real build is verified separately.
- name: Create frontend dist stub
run: mkdir -p frontend/dist && touch frontend/dist/index.html
- name: Go mod verify
run: go mod verify
- name: Go vet
run: go vet -tags webkit2_41 ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.5.0
args: --timeout 5m --build-tags webkit2_41
- name: govulncheck
uses: golang/govulncheck-action@v1
with:
go-version-input: ${{ env.GO_VERSION }}
go-package: ./...
repo-checkout: false
# ──────────────────────────────────────────────
# Go: run tests
# ──────────────────────────────────────────────
go-test:
name: Go Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libgtk-3-dev libwebkit2gtk-4.1-dev
# The go:embed directive in main.go requires frontend/dist to exist.
- name: Create frontend dist stub
run: mkdir -p frontend/dist && touch frontend/dist/index.html
- name: Run tests
run: go test -tags webkit2_41 -race -count=1 -timeout 120s ./...
# ──────────────────────────────────────────────
# Code generation: verify generated code is fresh
# ──────────────────────────────────────────────
codegen-check:
name: Code Generation Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Run code generation
run: go generate ./...
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated code is out of date. Run 'make generate' and commit the changes."
git diff --stat
git diff
exit 1
fi
echo "Generated code is up to date."
# ──────────────────────────────────────────────
# Frontend: type-check
# ──────────────────────────────────────────────
frontend:
name: Frontend Type Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type check
run: pnpm exec tsc --noEmit
# ──────────────────────────────────────────────
# Build verification: ensure it compiles
# (only runs on PRs; release builds are handled
# by the Build & Publish workflow)
# ──────────────────────────────────────────────
build-check:
name: Build Check (${{ matrix.platform }})
if: github.event_name == 'pull_request'
needs: [go-checks, go-test, codegen-check, frontend]
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
os: ubuntu-latest
build-name: yellowjacket
apt-deps: libasound2-dev
# - platform: darwin/universal
# os: macos-latest
# build-name: yellowjacket
# - platform: windows/amd64
# os: windows-latest
# build-name: yellowjacket.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.apt-deps }}
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Build with Wails
uses: dAppServer/wails-build-action@main
with:
build-name: ${{ matrix.build-name }}
build-platform: ${{ matrix.platform }}
go-version: ${{ env.GO_VERSION }}
package: false
app-working-directory: ${{ github.workspace }}