You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2026-10-23 12:08:57 +03:00
Cleanup CI (#1290)
* Cleanup old CircleCI related config. * Split integration tests to separate workflow file. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
executors:
|
||||
golang:
|
||||
docker:
|
||||
- image: busybox
|
||||
|
||||
jobs:
|
||||
noopjob:
|
||||
executor: golang
|
||||
|
||||
steps:
|
||||
- run:
|
||||
command: "true"
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
prometheus:
|
||||
jobs:
|
||||
- noopjob
|
||||
triggers:
|
||||
- schedule:
|
||||
cron: "0 0 30 2 *"
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
92
.github/workflows/ci.yml
vendored
92
.github/workflows/ci.yml
vendored
@@ -20,126 +20,50 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
|
||||
- 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
|
||||
- 18.1
|
||||
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.26-base
|
||||
env:
|
||||
DATA_SOURCE_NAME: 'postgresql://postgres:test@postgres:5432/circle_test?sslmode=disable'
|
||||
GOOPTS: '-v -tags integration'
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
|
||||
- run: make build
|
||||
- run: make test
|
||||
|
||||
|
||||
build:
|
||||
name: Build Prometheus for common architectures
|
||||
name: Build
|
||||
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 ]
|
||||
thread: [ 0, 1, 2, 3]
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci/build@42c3c84c865e5c1ab78543b929f7341eb2ef6123 # v0.6.1
|
||||
- uses: prometheus/promci/build@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
|
||||
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci/build@42c3c84c865e5c1ab78543b929f7341eb2ef6123 # v0.6.1
|
||||
with:
|
||||
parallelism: 12
|
||||
parallelism: 4
|
||||
thread: ${{ matrix.thread }}
|
||||
|
||||
publish_main:
|
||||
name: Publish main branch artifacts
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test_go, build_all]
|
||||
needs: [test_go, build]
|
||||
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci/publish_main@42c3c84c865e5c1ab78543b929f7341eb2ef6123 # v0.6.1
|
||||
- uses: prometheus/promci/publish_main@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
|
||||
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]
|
||||
needs: [test_go, build]
|
||||
if: |
|
||||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci/publish_release@42c3c84c865e5c1ab78543b929f7341eb2ef6123 # v0.6.1
|
||||
- uses: prometheus/promci/publish_release@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
|
||||
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 }}
|
||||
|
||||
49
.github/workflows/integration.yml
vendored
Normal file
49
.github/workflows/integration.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main, master, 'release-*']
|
||||
tags: ['v*']
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
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
|
||||
- 18.1
|
||||
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.26-base
|
||||
env:
|
||||
DATA_SOURCE_NAME: 'postgresql://postgres:test@postgres:5432/circle_test?sslmode=disable'
|
||||
GOOPTS: '-v -tags integration'
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
|
||||
- run: make build
|
||||
- run: make test
|
||||
@@ -1,5 +1,5 @@
|
||||
go:
|
||||
# This must match .circle/config.yml.
|
||||
# This must match .github/workflows/ci.yml.
|
||||
version: 1.26
|
||||
repository:
|
||||
path: github.com/prometheus-community/postgres_exporter
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
[](https://circleci.com/gh/prometheus-community/postgres_exporter)
|
||||
# PostgreSQL Server Exporter
|
||||
|
||||
[](https://github.com/prometheus-community/postgres_exporter/actions/workflows/ci.yml)
|
||||
[](https://coveralls.io/github/prometheus-community/postgres_exporter?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/prometheus-community/postgres_exporter)
|
||||
[](https://hub.docker.com/r/prometheuscommunity/postgres-exporter/tags)
|
||||
|
||||
# PostgreSQL Server Exporter
|
||||
|
||||
Prometheus exporter for PostgreSQL server metrics.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user