name: CI on: push: branches: [master] pull_request: branches: [master] permissions: contents: read concurrency: group: ci-${{ github.ref }} cancel-in-progress: true env: GO_VERSION: "1.25.0" GOLANGCI_VERSION: v2.12.2 GOVULN_VERSION: v1.1.4 GORELEASER_VERSION: v2.15.4 TASK_VERSION: v3.51.1 jobs: lint: name: Lint & format runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.2 - uses: actions/setup-go@v6.4.0 with: go-version: ${{ env.GO_VERSION }} cache: true - uses: arduino/setup-task@v2.0.0 with: version: ${{ env.TASK_VERSION }} repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Format check run: task fmt:check - name: Vet run: task vet - uses: golangci/golangci-lint-action@v9.2.1 with: version: ${{ env.GOLANGCI_VERSION }} args: --timeout=5m ./... test: name: Test (race) runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.2 - uses: actions/setup-go@v6.4.0 with: go-version: ${{ env.GO_VERSION }} cache: true - uses: arduino/setup-task@v2.0.0 with: version: ${{ env.TASK_VERSION }} repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tests run: task test vuln: name: govulncheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.2 - uses: actions/setup-go@v6.4.0 with: go-version: ${{ env.GO_VERSION }} cache: true - name: Install govulncheck run: go install golang.org/x/vuln/cmd/govulncheck@${{ env.GOVULN_VERSION }} - run: govulncheck ./... build-snapshot: name: Snapshot build (all targets) runs-on: ubuntu-latest needs: [lint, test] steps: - uses: actions/checkout@v6.0.2 with: fetch-depth: 0 - uses: actions/setup-go@v6.4.0 with: go-version: ${{ env.GO_VERSION }} cache: true - uses: goreleaser/goreleaser-action@v7.2.2 with: distribution: goreleaser version: ${{ env.GORELEASER_VERSION }} args: release --snapshot --clean --skip=publish,sign,docker,announce - uses: actions/upload-artifact@v7.0.1 with: name: snapshot-dist path: dist/ retention-days: 7