Merge pull request #86 from RichiH/dependabot/go_modules/golang.org/x… #114
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: | |
| pull_request: | |
| push: | |
| jobs: | |
| test_go: | |
| name: Go tests | |
| runs-on: ubuntu-latest | |
| # Whenever the Go version is updated here, .promu.yml | |
| # should also be updated. | |
| container: | |
| image: quay.io/prometheus/golang-builder:1.24-base | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | |
| - uses: ./.github/promci/actions/setup_environment | |
| - run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1 | |
| - run: go test --tags=stringlabels ./... | |
| test_windows: | |
| name: Go tests on Windows | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: 1.24.x | |
| - run: go test ./... -vet=off -v | |
| test_golang_oldest: | |
| name: Go tests with previous Go version | |
| runs-on: ubuntu-latest | |
| # The go verson in this image should be N-1 wrt test_go. | |
| container: | |
| image: quay.io/prometheus/golang-builder:1.23-base | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - run: make build | |
| - run: go test --tags=stringlabels ./... | |
| build_all: | |
| name: Build Prometheus for all architectures | |
| runs-on: ubuntu-latest | |
| if: | | |
| (github.event_name == 'push') | |
| || | |
| (github.event_name == 'pull_request') | |
| strategy: | |
| matrix: | |
| thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ] | |
| # Whenever the Go version is updated here, .promu.yml | |
| # should also be updated. | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | |
| - uses: ./.github/promci/actions/build | |
| with: | |
| parallelism: 12 | |
| thread: ${{ matrix.thread }} | |
| golangci: | |
| name: golangci-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Install Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: 1.24.x | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 | |
| with: | |
| version: v2.2.1 | |
| # fuzzing: | |
| # uses: ./.github/workflows/fuzzing.yml | |
| codeql: | |
| uses: ./.github/workflows/codeql-analysis.yml | |
| publish_main: | |
| name: Publish main branch artifacts | |
| runs-on: ubuntu-latest | |
| needs: [test_go, test_windows, golangci, codeql, build_all] | |
| if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | |
| - uses: ./.github/promci/actions/publish_main | |
| with: | |
| docker_hub_login: ${{ secrets.docker_hub_login }} | |
| docker_hub_password: ${{ secrets.docker_hub_password }} | |
| quay_io_login: ${{ secrets.quay_io_login }} | |
| quay_io_password: ${{ secrets.quay_io_password }} | |
| publish_release: | |
| name: Publish release artifacts | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: [test_go, test_windows, golangci, codeql, build_all] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | |
| - uses: ./.github/promci/actions/publish_release | |
| with: | |
| docker_hub_login: ${{ secrets.docker_hub_login }} | |
| docker_hub_password: ${{ secrets.docker_hub_password }} | |
| quay_io_login: ${{ secrets.quay_io_login }} | |
| quay_io_password: ${{ secrets.quay_io_password }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |