hatch-surf/.github/workflows/ci.yml
Naranmandakh Enkhbat 65b2435275 Merge PR #2: Phase 1 Foundation
Reviewed and merged Phase 1 Foundation PR. All tests pass, CI changes look good, linting config is comprehensive, and shared test utilities improve code quality. The merge preserves the existing CLI on main.
2026-06-24 11:39:33 +08:00

88 lines
1.9 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
- name: Check formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Files not formatted:"
gofmt -l .
exit 1
fi
- name: Vet
run: go vet ./...
- name: Test
run: go test ./... -v -race
- name: Build
run: CGO_ENABLED=0 go build -o /dev/null ./cmd/hatch
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t hatch:ci .
- name: Smoke test the Docker image
run: |
docker run --rm -d -p 8080:8080 --name hatch-ci hatch:ci
sleep 2
curl -fsS http://localhost:8080/healthz | grep -q 'ok'
docker stop hatch-ci
lint-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
lint-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check markdown formatting
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: '**/*.md'
continue-on-error: true
check-paperclip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Need full history for PR range
- name: Check for Paperclip references in commit messages
run: ./scripts/check-paperclip.sh
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_BASE_REF: ${{ github.base_ref }}