Skip to content

ci: verify generated configs, cancel stale runs, dedupe tests #1

ci: verify generated configs, cancel stale runs, dedupe tests

ci: verify generated configs, cancel stale runs, dedupe tests #1

Workflow file for this run

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: Run tests
run: go test -race -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 ./...