Windows runners are not available for this project; keep cross-build verification on Linux and rely on local PowerShell scripts for Windows packaging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
73 lines
1.4 KiB
YAML
73 lines
1.4 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26.2'
|
|
check-latest: true
|
|
cache: true
|
|
|
|
- name: go mod download
|
|
run: go mod download
|
|
|
|
- name: gofmt
|
|
run: |
|
|
out=$(gofmt -l $(go list -f '{{.Dir}}' ./...))
|
|
if [ -n "$out" ]; then
|
|
echo "gofmt drift:"
|
|
echo "$out"
|
|
exit 1
|
|
fi
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
- name: go build
|
|
run: go build ./...
|
|
|
|
- name: cross-build windows binary
|
|
env:
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
run: go build ./cmd/mototrbod ./cmd/mototrboctl
|
|
|
|
- name: go test (race)
|
|
run: go test -race ./...
|
|
|
|
lint:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26.2'
|
|
check-latest: true
|
|
cache: true
|
|
|
|
- name: install staticcheck
|
|
run: go install honnef.co/go/tools/cmd/staticcheck@latest
|
|
|
|
- name: staticcheck
|
|
run: staticcheck ./...
|
|
|
|
- name: install govulncheck
|
|
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
|
|
- name: govulncheck
|
|
run: govulncheck ./...
|