This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move to github action Signed-off-by: Julien Pivotto <[email protected]>
- Loading branch information
1 parent
2cc962d
commit 575d68c
Showing
7 changed files
with
128 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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,46 +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/[email protected] | ||
jobs: | ||
test: | ||
# Whenever the Go version is updated here, .promu.yml | ||
# should also be updated. | ||
|
||
executors: | ||
golang: | ||
docker: | ||
- image: cimg/go:1.18 | ||
- image: busybox | ||
|
||
jobs: | ||
noopjob: | ||
executor: golang | ||
|
||
steps: | ||
- prometheus/setup_environment | ||
- setup_remote_docker | ||
- run: make | ||
- prometheus/store_artifact: | ||
file: haproxy_exporter | ||
- run: | ||
command: "true" | ||
|
||
workflows: | ||
version: 2 | ||
haproxy_exporter: | ||
prometheus: | ||
jobs: | ||
- test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- prometheus/build: | ||
name: build | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- prometheus/publish_main: | ||
context: org-context | ||
requires: | ||
- test | ||
- build | ||
filters: | ||
branches: | ||
only: main | ||
- prometheus/publish_release: | ||
context: org-context | ||
requires: | ||
- test | ||
- build | ||
- noopjob | ||
triggers: | ||
- schedule: | ||
cron: "0 0 30 2 *" | ||
filters: | ||
tags: | ||
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/ | ||
branches: | ||
ignore: /.*/ | ||
only: | ||
- main |
This file contains 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,77 @@ | ||
--- | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
test: | ||
name: Test | ||
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.19-base | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: prometheus/[email protected] | ||
- uses: ./.github/promci/actions/setup_environment | ||
- run: make | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
thread: [ 0, 1, 2 ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: prometheus/[email protected] | ||
- uses: ./.github/promci/actions/build | ||
with: | ||
parallelism: 3 | ||
thread: ${{ matrix.thread }} | ||
|
||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '<1.19' | ||
- name: Lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.49.0 | ||
|
||
publish_main: | ||
name: Publish main branch artifacts | ||
runs-on: ubuntu-latest | ||
needs: [test, build] | ||
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: prometheus/[email protected] | ||
- 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 arfefacts | ||
runs-on: ubuntu-latest | ||
needs: [test, build] | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: prometheus/[email protected] | ||
- 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 }} |
This file was deleted.
Oops, something went wrong.
This file contains 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,21 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
commas: disable | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
indentation: | ||
spaces: consistent | ||
indent-sequences: consistent | ||
line-length: disable | ||
truthy: | ||
ignore: | | ||
.github/workflows/ci.yml |
This file contains 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 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 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