Skip to content

Commit 114858d

Browse files
committed
Migrate from CircleCI to GitHub Actions
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
1 parent 6b5938c commit 114858d

3 files changed

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

0 commit comments

Comments
 (0)