Skip to content

build(deps): bump actions/upload-pages-artifact from 3 to 5 #122

build(deps): bump actions/upload-pages-artifact from 3 to 5

build(deps): bump actions/upload-pages-artifact from 3 to 5 #122

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: test (${{ matrix.os }} / go ${{ matrix.go }})
strategy:
fail-fast: false
matrix:
# ubuntu-latest = linux/amd64; ubuntu-24.04-arm = linux/arm64 (free
# for public repos). macos-latest = darwin/arm64 (M-series).
# windows-latest = windows/amd64. Covers the full set of arches we
# cross-compile for, minus darwin/amd64 — the macos-13 Intel runner
# queues unreliably (frequent multi-hour waits on the free tier),
# so we rely on the build-cross job for compile coverage there.
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
go: ["1.24"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install clipboard tools (Linux)
if: runner.os == 'Linux'
# atotto/clipboard shells out to xclip/xsel on Linux; both need an
# X server. Xvfb provides a headless one so the round-trip test
# actually exercises the integration instead of skipping.
#
# The arm64 apt mirror is occasionally flaky — don't fail the whole
# job on a transient install error; the clipboard test will just
# skip if the tools aren't present.
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install -y xvfb xclip
- name: Build
run: go build ./...
- name: Test
shell: bash
run: |
# Run under xvfb only when both xvfb-run and xclip are actually
# available — covers the case where apt-get install hit a
# transient failure above.
if command -v xvfb-run >/dev/null && command -v xclip >/dev/null; then
xvfb-run -a go test -race -count=1 ./...
else
go test -race -count=1 ./...
fi
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.24"
cache: false
# Single linter run covers gofmt, goimports, go vet, staticcheck,
# errcheck, ineffassign, unused, misspell, unconvert, unparam.
# Config lives in .golangci.yml at the repo root.
- name: golangci-lint
uses: golangci/golangci-lint-action@v9.2.0
with:
version: v2.12.2
fuzz:
name: fuzz (parseFrontmatter, 30s)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.24"
cache: true
- name: Short fuzz run on YAML frontmatter parser
# Third-party SKILL.md content is untrusted; 30 s per PR is cheap
# insurance against yaml.v3 parser regressions. Longer runs can
# be scheduled nightly later.
run: go test -run=^$ -fuzz=FuzzParseFrontmatter -fuzztime=30s ./internal/scan/...
build-cross:
name: build (cross-compile)
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
target:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.24"
cache: true
- name: Build ${{ matrix.target.goos }}/${{ matrix.target.goarch }}
env:
GOOS: ${{ matrix.target.goos }}
GOARCH: ${{ matrix.target.goarch }}
CGO_ENABLED: 0
run: go build -o /tmp/skillscope ./cmd/skillscope