Skip to content

ghcr

ghcr #6

Workflow file for this run

name: CI
on:
push:
tags:
- 'v*'
branches:
- master
pull_request:
workflow_call:
jobs:
test_go:
name: Go tests
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.24-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/setup_environment
- 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: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/build
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: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}
verify-example-configs:
name: Verify
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.24-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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
needs: [test_go, build_all, verify-example-configs]
if: (github.event_name == 'push' && github.event.ref == 'refs/heads/master')
permissions:
packages: write
attestations: write
contents: read
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/restore_artifacts
- uses: ./.github/promci/actions/publish_images
with:
registry: ghcr.io
organization: clickhouse
login: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
publish_release:
name: Publish release artifacts
runs-on: ubuntu-latest
needs: [test_go, build_all, verify-example-configs]
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.'))
permissions:
packages: write
attestations: write
contents: read
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/restore_artifacts
- uses: ./.github/promci/actions/publish_release_images
with:
registry: ghcr.io
organization: clickhouse
login: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}