chore: update Prometheus Go dependencies #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Verify module files | |
| run: go mod tidy -diff | |
| - name: Verify generated configs | |
| run: make conf conf9 && git diff --exit-code pg_exporter.yml legacy/pg_exporter.yml | |
| - name: Verify standalone RPM package metadata | |
| run: | | |
| for config in package/nfpm-amd64-rpm.yaml package/nfpm-arm64-rpm.yaml; do | |
| grep -qx 'name: "pg-exporter"' "$config" | |
| grep -qx 'provides:' "$config" | |
| grep -qx 'replaces:' "$config" | |
| test "$(grep -c '^ - pg_exporter$' "$config")" -eq 2 | |
| done | |
| - name: Run tests | |
| run: go test -race -count=1 ./... | |
| # downstream distros (e.g. Debian dh-golang) build in GOPATH mode where | |
| # the pre-1.22 ServeMux is selected; keep the suite passing there too | |
| - name: Run tests with go1.21 ServeMux | |
| run: GODEBUG=httpmuxgo121=1 go test -count=1 ./... | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Cross-build supported targets | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./... | |
| CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./... | |
| CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build ./... | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build ./... | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build ./... | |
| CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./... |