Skip to content

Commit

Permalink
Migrate from CircleCI to GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce-Souers <[email protected]>
  • Loading branch information
bryce-souers committed Jan 5, 2025
1 parent 7d61fee commit dd02a2a
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 143 deletions.
75 changes: 0 additions & 75 deletions .circleci/config.yml

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
name: CI
on:
- push
- pull_request
jobs:
test:
name: Test
strategy:
matrix:
os:
- ubuntu-24.04
- windows-2022
- macos-13
- macos-14
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Read .promu.yml
uses: pietrobolcato/action-read-yaml@dd664040f4883322f6d143e58302062b35a46e4d
id: read_promu
with:
config: .promu.yml
- name: Set up Go
uses: actions/[email protected]
with:
go-version: ${{ steps.read_promu.outputs['go.version'] }}
- run: make build
- run: make test GOOPTS=-v

build_common:
name: Build common architectures
if: github.event_name == 'pull_request'
strategy:
matrix:
thread: [0, 1, 2]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Import PromCI
uses: prometheus/[email protected]
- name: Cross-build
uses: ./.github/promci/actions/build
with:
thread: ${{ matrix.thread }}
parallelism: 3
promu_opts: -p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386

build_all:
name: Build all architectures
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v0.'))
strategy:
matrix:
thread: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Import PromCI
uses: prometheus/[email protected]
- name: Cross-build
uses: ./.github/promci/actions/build
with:
thread: ${{ matrix.thread }}
parallelism: 12
promu_opts: -p linux

publish_master:
name: Publish master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs:
- test
- build_all
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Import PromCI
uses: prometheus/[email protected]
- name: Publish
uses: ./.github/promci/actions/publish_main
with:
docker_hub_login: ${{ secrets.DOCKER_HUB_LOGIN }}
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
quay_io_login: ${{ secrets.QUAY_IO_LOGIN }}
quay_io_password: ${{ secrets.QUAY_IO_PASSWORD }}

publish_release:
name: Publish release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.')
needs:
- test
- build_all
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Import PromCI
uses: prometheus/[email protected]
- name: Publish
uses: ./.github/promci/actions/publish_release
with:
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
docker_hub_login: ${{ secrets.DOCKER_HUB_LOGIN }}
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
quay_io_login: ${{ secrets.QUAY_IO_LOGIN }}
quay_io_password: ${{ secrets.QUAY_IO_PASSWORD }}
25 changes: 12 additions & 13 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
go:
# Whenever the Go version is updated here, .circle/config.yml should also be updated.
version: 1.23
version: 1.23
repository:
path: github.com/prometheus/blackbox_exporter
path: github.com/prometheus/blackbox_exporter
build:
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- blackbox.yml
- LICENSE
- NOTICE
files:
- blackbox.yml
- LICENSE
- NOTICE
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Blackbox exporter

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

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

[circleci]: https://circleci.com/gh/prometheus/blackbox_exporter
[hub]: https://hub.docker.com/r/prom/blackbox-exporter/
[quay]: https://quay.io/repository/prometheus/blackbox-exporter
17 changes: 0 additions & 17 deletions prober/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package prober
import (
"context"
"net"
"os"
"runtime"
"testing"
"time"
Expand Down Expand Up @@ -90,10 +89,6 @@ func recursiveDNSHandler(w dns.ResponseWriter, r *dns.Msg) {
}

func TestRecursiveDNSResponse(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

tests := []struct {
Probe config.DNSProbe
ShouldSucceed bool
Expand Down Expand Up @@ -247,10 +242,6 @@ func authoritativeDNSHandler(w dns.ResponseWriter, r *dns.Msg) {
}

func TestAuthoritativeDNSResponse(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

tests := []struct {
Probe config.DNSProbe
ShouldSucceed bool
Expand Down Expand Up @@ -398,10 +389,6 @@ func TestAuthoritativeDNSResponse(t *testing.T) {
}

func TestServfailDNSResponse(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

tests := []struct {
Probe config.DNSProbe
ShouldSucceed bool
Expand Down Expand Up @@ -475,10 +462,6 @@ func TestServfailDNSResponse(t *testing.T) {
}

func TestDNSProtocol(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

// This test assumes that listening TCP listens both IPv6 and IPv4 traffic and
// localhost resolves to both 127.0.0.1 and ::1. we must skip the test if either
// of these isn't true. This should be true for modern Linux systems.
Expand Down
24 changes: 0 additions & 24 deletions prober/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ import (
)

func TestGRPCConnection(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down Expand Up @@ -103,10 +99,6 @@ func TestGRPCConnection(t *testing.T) {
}

func TestMultipleGRPCservices(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down Expand Up @@ -172,10 +164,6 @@ func TestMultipleGRPCservices(t *testing.T) {
}

func TestGRPCTLSConnection(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

certExpiry := time.Now().AddDate(0, 0, 1)
testCertTmpl := generateCertificateTemplate(certExpiry, false)
testCertTmpl.IsCA = true
Expand Down Expand Up @@ -267,10 +255,6 @@ func TestGRPCTLSConnection(t *testing.T) {
}

func TestNoTLSConnection(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down Expand Up @@ -325,10 +309,6 @@ func TestNoTLSConnection(t *testing.T) {
}

func TestGRPCServiceNotFound(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down Expand Up @@ -381,10 +361,6 @@ func TestGRPCServiceNotFound(t *testing.T) {
}

func TestGRPCHealthCheckUnimplemented(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down
12 changes: 0 additions & 12 deletions prober/tcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ func TestTCPConnectionFails(t *testing.T) {
}

func TestTCPConnectionWithTLS(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", ":0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down Expand Up @@ -201,10 +197,6 @@ func TestTCPConnectionWithTLS(t *testing.T) {
}

func TestTCPConnectionWithTLSAndVerifiedCertificateChain(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

ln, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatalf("Error listening on socket: %s", err)
Expand Down Expand Up @@ -581,10 +573,6 @@ func TestTCPConnectionQueryResponseMatching(t *testing.T) {
}

func TestTCPConnectionProtocol(t *testing.T) {
if os.Getenv("CI") == "true" {
t.Skip("skipping; CI is failing on ipv6 dns requests")
}

// This test assumes that listening TCP listens both IPv6 and IPv4 traffic and
// localhost resolves to both 127.0.0.1 and ::1. we must skip the test if either
// of these isn't true. This should be true for modern Linux systems.
Expand Down
Loading

0 comments on commit dd02a2a

Please sign in to comment.