name: CI on: push: branches: [main] pull_request: branches: [main] permissions: contents: read jobs: lint-and-test: name: Lint + build + test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: "1.26.x" cache: false - name: Install templ run: go install github.com/a-h/templ/cmd/templ@v0.3.1001 - name: Generate templ run: templ generate - name: Verify go.mod + go.sum are tidy run: | go mod tidy git diff --exit-code go.mod go.sum - name: Vet run: go vet ./... - name: Build (host) run: | go build ./... GOOS=linux GOARCH=amd64 go build ./... - name: Test run: go test -race -count=1 -coverprofile=coverage.out ./... - name: Coverage summary run: | go tool cover -func=coverage.out | tee coverage.txt go tool cover -html=coverage.out -o coverage.html - name: Upload coverage artifact uses: actions/upload-artifact@v3 if: always() with: name: coverage path: | coverage.out coverage.txt coverage.html retention-days: 14