Skip to content

Merge pull request #1867 from roidelapluie/roidelapluie/sd-client-ada… #5

Merge pull request #1867 from roidelapluie/roidelapluie/sd-client-ada…

Merge pull request #1867 from roidelapluie/roidelapluie/sd-client-ada… #5

Workflow file for this run

name: CI
on:
push:
tags:
- 'v*'
branches:
- master
pull_request:
workflow_call:
permissions:
contents: read
jobs:
test_go:
name: Go tests
runs-on: ubuntu-latest
container:
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 test
build:
name: Build for common architectures
runs-on: ubuntu-latest
if: |
!(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
&&
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
strategy:
matrix:
thread: [ 0, 1, 2 ]
steps:
- uses: prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
with:
promu_opts: "-p linux/amd64 -p windows/amd64 -p darwin/amd64 -p linux/arm64 -p windows/arm64 -p darwin/arm64"
parallelism: 3
thread: ${{ matrix.thread }}
build_all:
name: Build for all architectures
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
strategy:
matrix:
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
steps:
- uses: prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
with:
parallelism: 12
thread: ${{ matrix.thread }}
verify-example-configs:
name: Verify
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.26-base
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: make build
- name: Verify example configs
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %
publish_master:
name: Publish master branch artifacts
runs-on: ubuntu-latest
permissions:
packages: write
needs: [test_go, build_all, verify-example-configs]
if: |
(github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
&&
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
steps:
- uses: prometheus/promci/publish_main@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
with:
docker_hub_organization: prometheuscommunity
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
ghcr_io_password: ${{ github.token }}
quay_io_organization: prometheuscommunity
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
packages: write
needs: [test_go, build_all, verify-example-configs]
if: |
(github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
&&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.'))
steps:
- uses: prometheus/promci/publish_release@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
with:
docker_hub_organization: prometheuscommunity
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
ghcr_io_password: ${{ github.token }}
quay_io_organization: prometheuscommunity
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
github_token: ${{ github.token }}