Skip to content

Commit dd02a2a

Browse files
committed
Migrate from CircleCI to GitHub Actions
Signed-off-by: Bryce-Souers <[email protected]>
1 parent 7d61fee commit dd02a2a

File tree

8 files changed

+127
-143
lines changed

8 files changed

+127
-143
lines changed

.circleci/config.yml

-75
This file was deleted.

.github/workflows/ci.yml

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
name: CI
3+
on:
4+
- push
5+
- pull_request
6+
jobs:
7+
test:
8+
name: Test
9+
strategy:
10+
matrix:
11+
os:
12+
- ubuntu-24.04
13+
- windows-2022
14+
- macos-13
15+
- macos-14
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/[email protected]
20+
- name: Read .promu.yml
21+
uses: pietrobolcato/action-read-yaml@dd664040f4883322f6d143e58302062b35a46e4d
22+
id: read_promu
23+
with:
24+
config: .promu.yml
25+
- name: Set up Go
26+
uses: actions/[email protected]
27+
with:
28+
go-version: ${{ steps.read_promu.outputs['go.version'] }}
29+
- run: make build
30+
- run: make test GOOPTS=-v
31+
32+
build_common:
33+
name: Build common architectures
34+
if: github.event_name == 'pull_request'
35+
strategy:
36+
matrix:
37+
thread: [0, 1, 2]
38+
runs-on: ubuntu-24.04
39+
steps:
40+
- name: Checkout
41+
uses: actions/[email protected]
42+
- name: Import PromCI
43+
uses: prometheus/[email protected]
44+
- name: Cross-build
45+
uses: ./.github/promci/actions/build
46+
with:
47+
thread: ${{ matrix.thread }}
48+
parallelism: 3
49+
promu_opts: -p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386
50+
51+
build_all:
52+
name: Build all architectures
53+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v0.'))
54+
strategy:
55+
matrix:
56+
thread: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- name: Checkout
60+
uses: actions/[email protected]
61+
- name: Import PromCI
62+
uses: prometheus/[email protected]
63+
- name: Cross-build
64+
uses: ./.github/promci/actions/build
65+
with:
66+
thread: ${{ matrix.thread }}
67+
parallelism: 12
68+
promu_opts: -p linux
69+
70+
publish_master:
71+
name: Publish master
72+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
73+
needs:
74+
- test
75+
- build_all
76+
runs-on: ubuntu-24.04
77+
steps:
78+
- name: Checkout
79+
uses: actions/[email protected]
80+
- name: Import PromCI
81+
uses: prometheus/[email protected]
82+
- name: Publish
83+
uses: ./.github/promci/actions/publish_main
84+
with:
85+
docker_hub_login: ${{ secrets.DOCKER_HUB_LOGIN }}
86+
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
87+
quay_io_login: ${{ secrets.QUAY_IO_LOGIN }}
88+
quay_io_password: ${{ secrets.QUAY_IO_PASSWORD }}
89+
90+
publish_release:
91+
name: Publish release
92+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.')
93+
needs:
94+
- test
95+
- build_all
96+
runs-on: ubuntu-24.04
97+
steps:
98+
- name: Checkout
99+
uses: actions/[email protected]
100+
- name: Import PromCI
101+
uses: prometheus/[email protected]
102+
- name: Publish
103+
uses: ./.github/promci/actions/publish_release
104+
with:
105+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
106+
docker_hub_login: ${{ secrets.DOCKER_HUB_LOGIN }}
107+
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
108+
quay_io_login: ${{ secrets.QUAY_IO_LOGIN }}
109+
quay_io_password: ${{ secrets.QUAY_IO_PASSWORD }}

.promu.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
go:
2-
# Whenever the Go version is updated here, .circle/config.yml should also be updated.
3-
version: 1.23
2+
version: 1.23
43
repository:
5-
path: github.com/prometheus/blackbox_exporter
4+
path: github.com/prometheus/blackbox_exporter
65
build:
7-
ldflags: |
8-
-X github.com/prometheus/common/version.Version={{.Version}}
9-
-X github.com/prometheus/common/version.Revision={{.Revision}}
10-
-X github.com/prometheus/common/version.Branch={{.Branch}}
11-
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
12-
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
6+
ldflags: |
7+
-X github.com/prometheus/common/version.Version={{.Version}}
8+
-X github.com/prometheus/common/version.Revision={{.Revision}}
9+
-X github.com/prometheus/common/version.Branch={{.Branch}}
10+
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
11+
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
1312
tarball:
14-
files:
15-
- blackbox.yml
16-
- LICENSE
17-
- NOTICE
13+
files:
14+
- blackbox.yml
15+
- LICENSE
16+
- NOTICE

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Blackbox exporter
22

3-
[![CircleCI](https://circleci.com/gh/prometheus/blackbox_exporter/tree/master.svg?style=shield)][circleci]
3+
[![CI](https://github.com/prometheus/blackbox_exporter/actions/workflows/ci.yml/badge.svg)](https://github.com/prometheus/blackbox_exporter/actions/workflows/ci.yml)
44
[![Docker Repository on Quay](https://quay.io/repository/prometheus/blackbox-exporter/status)][quay]
55
[![Docker Pulls](https://img.shields.io/docker/pulls/prom/blackbox-exporter.svg?maxAge=604800)][hub]
66

@@ -159,6 +159,5 @@ The ICMP probe requires elevated privileges to function:
159159
* *BSD*: root user is required.
160160
* *OS X*: No additional privileges are needed.
161161

162-
[circleci]: https://circleci.com/gh/prometheus/blackbox_exporter
163162
[hub]: https://hub.docker.com/r/prom/blackbox-exporter/
164163
[quay]: https://quay.io/repository/prometheus/blackbox-exporter

prober/dns_test.go

-17
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package prober
1616
import (
1717
"context"
1818
"net"
19-
"os"
2019
"runtime"
2120
"testing"
2221
"time"
@@ -90,10 +89,6 @@ func recursiveDNSHandler(w dns.ResponseWriter, r *dns.Msg) {
9089
}
9190

9291
func TestRecursiveDNSResponse(t *testing.T) {
93-
if os.Getenv("CI") == "true" {
94-
t.Skip("skipping; CI is failing on ipv6 dns requests")
95-
}
96-
9792
tests := []struct {
9893
Probe config.DNSProbe
9994
ShouldSucceed bool
@@ -247,10 +242,6 @@ func authoritativeDNSHandler(w dns.ResponseWriter, r *dns.Msg) {
247242
}
248243

249244
func TestAuthoritativeDNSResponse(t *testing.T) {
250-
if os.Getenv("CI") == "true" {
251-
t.Skip("skipping; CI is failing on ipv6 dns requests")
252-
}
253-
254245
tests := []struct {
255246
Probe config.DNSProbe
256247
ShouldSucceed bool
@@ -398,10 +389,6 @@ func TestAuthoritativeDNSResponse(t *testing.T) {
398389
}
399390

400391
func TestServfailDNSResponse(t *testing.T) {
401-
if os.Getenv("CI") == "true" {
402-
t.Skip("skipping; CI is failing on ipv6 dns requests")
403-
}
404-
405392
tests := []struct {
406393
Probe config.DNSProbe
407394
ShouldSucceed bool
@@ -475,10 +462,6 @@ func TestServfailDNSResponse(t *testing.T) {
475462
}
476463

477464
func TestDNSProtocol(t *testing.T) {
478-
if os.Getenv("CI") == "true" {
479-
t.Skip("skipping; CI is failing on ipv6 dns requests")
480-
}
481-
482465
// This test assumes that listening TCP listens both IPv6 and IPv4 traffic and
483466
// localhost resolves to both 127.0.0.1 and ::1. we must skip the test if either
484467
// of these isn't true. This should be true for modern Linux systems.

prober/grpc_test.go

-24
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ import (
3535
)
3636

3737
func TestGRPCConnection(t *testing.T) {
38-
if os.Getenv("CI") == "true" {
39-
t.Skip("skipping; CI is failing on ipv6 dns requests")
40-
}
41-
4238
ln, err := net.Listen("tcp", "localhost:0")
4339
if err != nil {
4440
t.Fatalf("Error listening on socket: %s", err)
@@ -103,10 +99,6 @@ func TestGRPCConnection(t *testing.T) {
10399
}
104100

105101
func TestMultipleGRPCservices(t *testing.T) {
106-
if os.Getenv("CI") == "true" {
107-
t.Skip("skipping; CI is failing on ipv6 dns requests")
108-
}
109-
110102
ln, err := net.Listen("tcp", "localhost:0")
111103
if err != nil {
112104
t.Fatalf("Error listening on socket: %s", err)
@@ -172,10 +164,6 @@ func TestMultipleGRPCservices(t *testing.T) {
172164
}
173165

174166
func TestGRPCTLSConnection(t *testing.T) {
175-
if os.Getenv("CI") == "true" {
176-
t.Skip("skipping; CI is failing on ipv6 dns requests")
177-
}
178-
179167
certExpiry := time.Now().AddDate(0, 0, 1)
180168
testCertTmpl := generateCertificateTemplate(certExpiry, false)
181169
testCertTmpl.IsCA = true
@@ -267,10 +255,6 @@ func TestGRPCTLSConnection(t *testing.T) {
267255
}
268256

269257
func TestNoTLSConnection(t *testing.T) {
270-
if os.Getenv("CI") == "true" {
271-
t.Skip("skipping; CI is failing on ipv6 dns requests")
272-
}
273-
274258
ln, err := net.Listen("tcp", "localhost:0")
275259
if err != nil {
276260
t.Fatalf("Error listening on socket: %s", err)
@@ -325,10 +309,6 @@ func TestNoTLSConnection(t *testing.T) {
325309
}
326310

327311
func TestGRPCServiceNotFound(t *testing.T) {
328-
if os.Getenv("CI") == "true" {
329-
t.Skip("skipping; CI is failing on ipv6 dns requests")
330-
}
331-
332312
ln, err := net.Listen("tcp", "localhost:0")
333313
if err != nil {
334314
t.Fatalf("Error listening on socket: %s", err)
@@ -381,10 +361,6 @@ func TestGRPCServiceNotFound(t *testing.T) {
381361
}
382362

383363
func TestGRPCHealthCheckUnimplemented(t *testing.T) {
384-
if os.Getenv("CI") == "true" {
385-
t.Skip("skipping; CI is failing on ipv6 dns requests")
386-
}
387-
388364
ln, err := net.Listen("tcp", "localhost:0")
389365
if err != nil {
390366
t.Fatalf("Error listening on socket: %s", err)

prober/tcp_test.go

-12
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ func TestTCPConnectionFails(t *testing.T) {
7171
}
7272

7373
func TestTCPConnectionWithTLS(t *testing.T) {
74-
if os.Getenv("CI") == "true" {
75-
t.Skip("skipping; CI is failing on ipv6 dns requests")
76-
}
77-
7874
ln, err := net.Listen("tcp", ":0")
7975
if err != nil {
8076
t.Fatalf("Error listening on socket: %s", err)
@@ -201,10 +197,6 @@ func TestTCPConnectionWithTLS(t *testing.T) {
201197
}
202198

203199
func TestTCPConnectionWithTLSAndVerifiedCertificateChain(t *testing.T) {
204-
if os.Getenv("CI") == "true" {
205-
t.Skip("skipping; CI is failing on ipv6 dns requests")
206-
}
207-
208200
ln, err := net.Listen("tcp", "127.0.0.1:0")
209201
if err != nil {
210202
t.Fatalf("Error listening on socket: %s", err)
@@ -581,10 +573,6 @@ func TestTCPConnectionQueryResponseMatching(t *testing.T) {
581573
}
582574

583575
func TestTCPConnectionProtocol(t *testing.T) {
584-
if os.Getenv("CI") == "true" {
585-
t.Skip("skipping; CI is failing on ipv6 dns requests")
586-
}
587-
588576
// This test assumes that listening TCP listens both IPv6 and IPv4 traffic and
589577
// localhost resolves to both 127.0.0.1 and ::1. we must skip the test if either
590578
// of these isn't true. This should be true for modern Linux systems.

0 commit comments

Comments
 (0)