-
Notifications
You must be signed in to change notification settings - Fork 807
Update GitHub Actions to run all CI #1231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SuperQ
merged 3 commits into
prometheus-community:master
from
sysadmind:github-actions-v1
Dec 12, 2025
+165
−89
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,103 +1,33 @@ | ||
| --- | ||
| version: 2.1 | ||
| # Prometheus has switched to GitHub action. | ||
| # Circle CI is not disabled repository-wise so that previous pull requests | ||
| # continue working. | ||
| # This file does not generate any CircleCI workflow. | ||
|
|
||
| orbs: | ||
| prometheus: prometheus/prometheus@0.17.1 | ||
| version: 2.1 | ||
|
|
||
| executors: | ||
| # This must match .promu.yml. | ||
| golang: | ||
| docker: | ||
| - image: cimg/go:1.25 | ||
| - image: busybox | ||
|
|
||
| jobs: | ||
| test: | ||
| noopjob: | ||
| executor: golang | ||
|
|
||
| steps: | ||
| - prometheus/setup_environment | ||
| - run: GOHOSTARCH=386 GOARCH=386 make test | ||
| - run: make | ||
| - prometheus/store_artifact: | ||
| file: postgres_exporter | ||
|
|
||
| integration: | ||
| docker: | ||
| - image: cimg/go:1.25 | ||
| - image: << parameters.postgres_image >> | ||
| environment: | ||
| POSTGRES_DB: circle_test | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: test | ||
|
|
||
| parameters: | ||
| postgres_image: | ||
| type: string | ||
|
|
||
| environment: | ||
| DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable' | ||
| GOOPTS: '-v -tags integration' | ||
|
|
||
| steps: | ||
| - checkout | ||
| - setup_remote_docker | ||
| - run: docker version | ||
| - run: make build | ||
| - run: make test | ||
| - run: | ||
| command: "true" | ||
|
|
||
| workflows: | ||
| version: 2 | ||
| postgres_exporter: | ||
| prometheus: | ||
| jobs: | ||
| - test: | ||
| filters: | ||
| tags: | ||
| only: /.*/ | ||
| - integration: | ||
| matrix: | ||
| parameters: | ||
| postgres_image: | ||
| - cimg/postgres:13.22 | ||
| - cimg/postgres:14.19 | ||
| - cimg/postgres:15.14 | ||
| - cimg/postgres:16.10 | ||
| - cimg/postgres:17.6 | ||
| - prometheus/build: | ||
| name: build | ||
| parallelism: 3 | ||
| promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386" | ||
| filters: | ||
| tags: | ||
| ignore: /^v.*/ | ||
| branches: | ||
| ignore: /^(main|master|release-.*|.*build-all.*)$/ | ||
| - prometheus/build: | ||
| name: build_all | ||
| parallelism: 12 | ||
| filters: | ||
| branches: | ||
| only: /^(main|master|release-.*|.*build-all.*)$/ | ||
| tags: | ||
| only: /^v.*/ | ||
| - prometheus/publish_master: | ||
| context: org-context | ||
| docker_hub_organization: prometheuscommunity | ||
| quay_io_organization: prometheuscommunity | ||
| requires: | ||
| - test | ||
| - build_all | ||
| filters: | ||
| branches: | ||
| only: master | ||
| - prometheus/publish_release: | ||
| context: org-context | ||
| docker_hub_organization: prometheuscommunity | ||
| quay_io_organization: prometheuscommunity | ||
| requires: | ||
| - test | ||
| - build_all | ||
| filters: | ||
| tags: | ||
| only: /^v.*/ | ||
| branches: | ||
| ignore: /.*/ | ||
| - noopjob | ||
| triggers: | ||
| - schedule: | ||
| cron: "0 0 30 2 *" | ||
| filters: | ||
| branches: | ||
| only: | ||
| - main | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| --- | ||
| name: CI | ||
| on: | ||
| pull_request: | ||
| push: | ||
|
|
||
| jobs: | ||
| test_go: | ||
| name: Go tests | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| # Whenever the Go version is updated here, .promu.yml | ||
| # should also be updated. | ||
| image: quay.io/prometheus/golang-builder:1.25-base | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | ||
| - uses: ./.github/promci/actions/setup_environment | ||
| - run: make test | ||
| - run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1 | ||
| integration_tests: | ||
| name: Integration tests | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| # Define Postgres versions to test against. | ||
| postgres_version: | ||
| - 13.22 | ||
| - 14.19 | ||
| - 15.14 | ||
| - 16.10 | ||
| - 17.6 | ||
| services: | ||
| postgres: | ||
| image: postgres:${{ matrix.postgres_version }} | ||
| env: | ||
| POSTGRES_DB: circle_test | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: test | ||
| # options: >- | ||
| # --health-cmd="pg_isready -U postgres -d circle_test" | ||
| # --health-interval=10s | ||
| # --health-timeout=5s | ||
| # --health-retries=5 | ||
| container: | ||
| # Whenever the Go version is updated here, .promu.yml | ||
| # should also be updated. | ||
| image: quay.io/prometheus/golang-builder:1.25-base | ||
| env: | ||
| DATA_SOURCE_NAME: 'postgresql://postgres:test@postgres:5432/circle_test?sslmode=disable' | ||
| GOOPTS: '-v -tags integration' | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | ||
| - uses: ./.github/promci/actions/setup_environment | ||
| - run: make build | ||
| - run: make test | ||
|
|
||
|
|
||
| build: | ||
| name: Build Prometheus for common architectures | ||
| runs-on: ubuntu-latest | ||
| if: | | ||
| !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | ||
| && | ||
| !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-')) | ||
| && | ||
| !(github.event_name == 'push' && github.event.ref == 'refs/heads/main') | ||
| && | ||
| !(github.event_name == 'push' && github.event.ref == 'refs/heads/master') | ||
| strategy: | ||
| matrix: | ||
| thread: [ 0, 1, 2 ] | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | ||
| - uses: ./.github/promci/actions/build | ||
| with: | ||
| promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386" | ||
| parallelism: 3 | ||
| thread: ${{ matrix.thread }} | ||
|
|
||
| build_all: | ||
| name: Build Prometheus for all architectures | ||
| runs-on: ubuntu-latest | ||
| if: | | ||
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | ||
| || | ||
| (github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-')) | ||
| || | ||
| (github.event_name == 'push' && github.event.ref == 'refs/heads/main') | ||
| || | ||
| (github.event_name == 'push' && github.event.ref == 'refs/heads/master') | ||
| 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | ||
| - uses: ./.github/promci/actions/build | ||
| with: | ||
| parallelism: 12 | ||
| thread: ${{ matrix.thread }} | ||
|
|
||
| publish_main: | ||
| # https://github.com/prometheus/promci/blob/52c7012f5f0070d7281b8db4a119e21341d43c91/actions/publish_main/action.yml | ||
| name: Publish main branch artifacts | ||
| runs-on: ubuntu-latest | ||
| needs: [test_go, build_all] | ||
| if: | | ||
| (github.event_name == 'push' && github.event.ref == 'refs/heads/main') | ||
| || | ||
| (github.event_name == 'push' && github.event.ref == 'refs/heads/master') | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | ||
| - uses: ./.github/promci/actions/publish_main | ||
| with: | ||
| docker_hub_organization: prometheuscommunity | ||
| docker_hub_login: ${{ secrets.docker_hub_login }} | ||
| docker_hub_password: ${{ secrets.docker_hub_password }} | ||
| quay_io_organization: prometheuscommunity | ||
| quay_io_login: ${{ secrets.quay_io_login }} | ||
| quay_io_password: ${{ secrets.quay_io_password }} | ||
|
|
||
| publish_release: | ||
| name: Publish release artefacts | ||
| runs-on: ubuntu-latest | ||
| needs: [test_go, build_all] | ||
| if: | | ||
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7 | ||
| - uses: ./.github/promci/actions/publish_release | ||
| with: | ||
| docker_hub_organization: prometheuscommunity | ||
| docker_hub_login: ${{ secrets.docker_hub_login }} | ||
| docker_hub_password: ${{ secrets.docker_hub_password }} | ||
| quay_io_organization: prometheuscommunity | ||
| quay_io_login: ${{ secrets.quay_io_login }} | ||
| quay_io_password: ${{ secrets.quay_io_password }} | ||
| github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # Adding queries to this file is deprecated | ||
| # Example queries have been transformed into collectors. | ||
| # Example queries have been transformed into collectors. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a formatting fix that CI won't pass without |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if we should just delete this file entirely. I think we need it short term while we get PRs merged or rebased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, we can do this in 2 phases. First get this working, then stop CircleCI, then delete the file.