name: CI on: push: branches: [main] pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: name: Test (${{ matrix.os }}) timeout-minutes: 30 strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Check out source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod cache: true cache-dependency-path: go.sum - name: Verify dependency checksums run: go mod verify - name: Verify formatting if: runner.os == 'Linux' run: test -z "$(gofmt -l cmd internal)" - name: Test run: go test -shuffle=on ./... - name: Test with race detector run: go test -race ./... - name: Vet run: go vet ./... - name: Build run: go build -trimpath ./cmd/domainops vulnerability-scan: name: Go vulnerability scan timeout-minutes: 15 runs-on: ubuntu-latest steps: - name: Check out source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod cache: true cache-dependency-path: go.sum - name: Scan reachable code run: go run golang.org/x/vuln/cmd/govulncheck@v1.6.0 ./... release-config: name: Validate release configuration timeout-minutes: 10 runs-on: ubuntu-latest steps: - name: Check out full history uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Check GoReleaser configuration uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3 with: distribution: goreleaser version: v2.17.0 args: check cross-build: name: Cross-build supported targets timeout-minutes: 20 runs-on: ubuntu-latest steps: - name: Check out source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod cache: true cache-dependency-path: go.sum - name: Build supported targets shell: bash run: | set -euo pipefail for os in linux darwin; do for arch in amd64 arm64; do CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -trimpath -o "build/domainops-$os-$arch" ./cmd/domainops done done