cli/.github/workflows/ci.yml
Snider aeb852c5e5 ci: use core CLI for QA and standardize workflows
- ci.yml: Download latest dev release, run `core go qa`, build matrix
- release.yml: Use go-version-file, consistent artifact handling
- dev-release.yml: Add checksums, cleaner version string
- coverage.yml: Standardize setup-go version, add CLI verification

All workflows now use:
- go-version-file for consistent Go version
- upload-artifact@v4 / download-artifact@v4
- Proper version injection via ldflags

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 11:05:26 +00:00

73 lines
1.7 KiB
YAML

name: CI
on:
push:
branches: [dev, main]
pull_request:
branches: [dev, main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Download core CLI
run: |
curl -sL "https://github.com/host-uk/core/releases/download/dev/core-linux-amd64" -o core
chmod +x core
sudo mv core /usr/local/bin/core
core --version
- name: Run QA
run: core go qa
build:
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build CLI
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: |
EXT=""
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
VERSION="${GITHUB_REF_NAME:-dev}-$(git rev-parse --short HEAD)"
go build -trimpath \
-ldflags="-s -w -X github.com/host-uk/core/pkg/cli.AppVersion=${VERSION}" \
-o core-${GOOS}-${GOARCH}${EXT} .
- name: Verify build
if: matrix.goos == 'linux'
run: |
chmod +x core-linux-amd64
./core-linux-amd64 --version