-
Notifications
You must be signed in to change notification settings - Fork 807
Migrate to GitHub Actions #1017
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
Open
SuperQ
wants to merge
1
commit into
main
Choose a base branch
from
superq/ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+153
−87
Open
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,101 +1,33 @@ | ||
| --- | ||
| # 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. | ||
|
|
||
| version: 2.1 | ||
| orbs: | ||
| prometheus: prometheus/prometheus@0.17.1 | ||
|
|
||
| executors: | ||
| # Whenever the Go version is updated here, .promu.yml | ||
| # should also be updated. | ||
| golang: | ||
| docker: | ||
| - image: cimg/go:1.26 | ||
| - image: busybox | ||
|
|
||
| jobs: | ||
| test: | ||
| noopjob: | ||
| executor: golang | ||
|
|
||
| steps: | ||
| - prometheus/setup_environment | ||
| - run: make check_license style staticcheck unused build test-short | ||
| - prometheus/store_artifact: | ||
| file: mysqld_exporter | ||
| integration: | ||
| docker: | ||
| - image: cimg/go:1.26 | ||
| - image: << parameters.mysql_image >> | ||
| environment: | ||
| MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
| MYSQL_ROOT_HOST: '%' | ||
| parameters: | ||
| mysql_image: | ||
| type: string | ||
| steps: | ||
| - checkout | ||
| - setup_remote_docker | ||
| - run: docker version | ||
| - run: docker-compose --version | ||
| - run: make build | ||
| - run: make test | ||
| mixin: | ||
| executor: golang | ||
| steps: | ||
| - checkout | ||
| - run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest | ||
| - run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest | ||
| - run: make -C mysqld-mixin lint build | ||
| - run: | ||
| command: "true" | ||
|
|
||
| workflows: | ||
| version: 2 | ||
| mysqld_exporter: | ||
| jobs: | ||
| - test: | ||
| filters: | ||
| tags: | ||
| only: /.*/ | ||
| - integration: | ||
| matrix: | ||
| parameters: | ||
| mysql_image: | ||
| - percona:5.6 | ||
| - mysql:5.7.33 | ||
| - mysql:8.0 | ||
| - mysql:8.4 | ||
| - mariadb:10.5 | ||
| - mariadb:10.6 | ||
| - mariadb:10.11 | ||
| - mariadb:11.4 | ||
| - 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|release-.*|.*build-all.*)$/ | ||
| - prometheus/build: | ||
| name: build_all | ||
| parallelism: 12 | ||
| filters: | ||
| branches: | ||
| only: /^(main|release-.*|.*build-all.*)$/ | ||
| tags: | ||
| only: /^v.*/ | ||
| - mixin: | ||
| filters: | ||
| tags: | ||
| only: /.*/ | ||
| - prometheus/publish_main: | ||
| context: org-context | ||
| requires: | ||
| - test | ||
| - build_all | ||
| filters: | ||
| branches: | ||
| only: main | ||
| - prometheus/publish_release: | ||
| context: org-context | ||
| requires: | ||
| - test | ||
| - build_all | ||
| - noopjob | ||
| triggers: | ||
| - schedule: | ||
| cron: "0 0 30 2 *" | ||
| filters: | ||
| tags: | ||
| only: /^v.*/ | ||
| branches: | ||
| ignore: /.*/ | ||
| 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
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,126 @@ | ||
| --- | ||
| name: CI | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main, 'release-*'] | ||
| tags: ['v*'] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| 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.26-base | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0 | ||
| - run: make | ||
| - run: git diff --exit-code | ||
|
|
||
| mixins: | ||
| name: Test mixins | ||
| 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.26-base | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest | ||
| - run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest | ||
| - run: make -C mysqld-mixin lint build | ||
|
|
||
| integration: | ||
| name: Integration 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.26-base | ||
| services: | ||
| mysqld: | ||
| image: ${{ matrix.mysql_image }} | ||
| env: | ||
| MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
| MYSQL_ROOT_HOST: '%' | ||
| options: >- | ||
| --health-cmd="mysqladmin ping" | ||
| --health-interval=10s | ||
| --health-timeout=5s | ||
| --health-retries=10 | ||
| strategy: | ||
| matrix: | ||
| mysql_image: | ||
| - percona:5.6 | ||
| - mysql:5.7.33 | ||
| - mysql:8.0 | ||
| - mysql:8.4 | ||
| - mariadb:10.5 | ||
| - mariadb:10.6 | ||
| - mariadb:10.11 | ||
| - mariadb:11.4 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - run: make build | ||
| - run: make test | ||
| - run: git diff --exit-code | ||
|
|
||
| build: | ||
| name: Build mysqld_exporter for all architectures | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| thread: [ 0, 1, 2, 3] | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: prometheus/promci/build@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0 | ||
| with: | ||
| parallelism: 4 | ||
| thread: ${{ matrix.thread }} | ||
|
|
||
| publish_main: | ||
| name: Publish main branch artifacts | ||
| runs-on: ubuntu-latest | ||
| needs: [test_go, build, integration] | ||
| if: (github.event_name == 'push' && github.event.ref == 'refs/heads/main') | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: prometheus/promci/publish_main@42c3c84c865e5c1ab78543b929f7341eb2ef6123 # v0.6.1 | ||
| 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 | ||
| needs: [test_go, build, integration] | ||
| if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: prometheus/promci/publish_release@42c3c84c865e5c1ab78543b929f7341eb2ef6123 # v0.6.1 | ||
| 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.PROMBOT_GITHUB_TOKEN }} | ||
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.