Skip to content

Commit 79fc220

Browse files
authored
Merge pull request #985 from prometheus/remove-circleCI
Migrate from CircleCI to GitHub Actions
2 parents 6b5938c + b3b13ec commit 79fc220

3 files changed

Lines changed: 125 additions & 147 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 146 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
name: CI
33
on:
44
pull_request:
5+
workflow_call:
56
push:
67

8+
permissions:
9+
contents: read
10+
711
jobs:
812
yamllint:
913
name: Yaml lint
@@ -13,5 +17,22 @@ jobs:
1317
# should also be updated.
1418
image: quay.io/prometheus/golang-builder:1.26-base
1519
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
1723
- run: make yamllint
24+
25+
test_go:
26+
name: Go build and tests
27+
runs-on: ubuntu-latest
28+
container:
29+
# Whenever the Go version is updated here, .promu.yml
30+
# should also be updated.
31+
image: quay.io/prometheus/golang-builder:1.26-base
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
persist-credentials: false
36+
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
37+
- run: make all
38+
- run: make -C prombench check_config

.github/workflows/publish.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
name: Publish
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
ci:
14+
name: Run CI
15+
uses: ./.github/workflows/ci.yml
16+
17+
publish_infra:
18+
name: Publish infra
19+
runs-on: ubuntu-latest
20+
needs: ci
21+
env:
22+
DOCKER_ORG: ${{ vars.DOCKER_ORG || 'prominfra' }}
23+
DOCKER_REGISTRY: docker.io
24+
DOCKER_IMAGE_TAG: master
25+
steps:
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
29+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
30+
with:
31+
go-version: 1.26.x
32+
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
33+
- name: Build infra binary
34+
run: make build
35+
env:
36+
PROMU_BINARIES: infra
37+
- name: Log in to Docker Hub
38+
run: echo "${{ secrets.docker_hub_password }}" | docker login -u "${{ secrets.docker_hub_login }}" --password-stdin "${DOCKER_REGISTRY}"
39+
- name: Build image
40+
run: >-
41+
docker build
42+
-t "${DOCKER_REGISTRY}/${DOCKER_ORG}/infra:${DOCKER_IMAGE_TAG}"
43+
-f "infra/Dockerfile"
44+
"infra/"
45+
- name: Publish image
46+
run: docker push "${DOCKER_REGISTRY}/${DOCKER_ORG}/infra:${DOCKER_IMAGE_TAG}"
47+
48+
publish_others:
49+
name: Publish ${{ matrix.image }}
50+
runs-on: ubuntu-latest
51+
needs: publish_infra
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
include:
56+
- image: prombench
57+
dockerfile: prombench/Dockerfile
58+
context: prombench/
59+
- image: amgithubnotifier
60+
dockerfile: tools/amGithubNotifier/Dockerfile
61+
context: tools/amGithubNotifier/
62+
- image: comment-monitor
63+
dockerfile: tools/comment-monitor/Dockerfile
64+
context: tools/comment-monitor/
65+
- image: fake-webserver
66+
dockerfile: tools/fake-webserver/Dockerfile
67+
context: tools/fake-webserver/
68+
- image: scaler
69+
dockerfile: tools/scaler/Dockerfile
70+
context: tools/scaler/
71+
- image: load-generator
72+
dockerfile: tools/load-generator/Dockerfile
73+
context: tools/load-generator/
74+
- image: prometheus-builder
75+
dockerfile: tools/prometheus-builder/Dockerfile
76+
context: tools/prometheus-builder/
77+
- image: block-sync
78+
dockerfile: tools/block-sync/Dockerfile
79+
context: tools/block-sync/
80+
env:
81+
DOCKER_ORG: ${{ vars.DOCKER_ORG || 'prominfra' }}
82+
DOCKER_REGISTRY: docker.io
83+
DOCKER_IMAGE_TAG: master
84+
steps:
85+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
86+
with:
87+
persist-credentials: false
88+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
89+
with:
90+
go-version: 1.26.x
91+
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
92+
- name: Build binaries
93+
run: make build
94+
- name: Log in to Docker Hub
95+
run: echo "${{ secrets.docker_hub_password }}" | docker login -u "${{ secrets.docker_hub_login }}" --password-stdin "${DOCKER_REGISTRY}"
96+
- name: Build image
97+
run: >-
98+
docker build
99+
-t "${DOCKER_REGISTRY}/${DOCKER_ORG}/${{ matrix.image }}:${DOCKER_IMAGE_TAG}"
100+
-f "${{ matrix.dockerfile }}"
101+
"${{ matrix.context }}"
102+
- name: Publish image
103+
run: docker push "${DOCKER_REGISTRY}/${DOCKER_ORG}/${{ matrix.image }}:${DOCKER_IMAGE_TAG}"

0 commit comments

Comments
 (0)