blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

Migrate from CircleCI to GitHub Actions

Open bryce-souers opened this issue 11 months ago • 2 comments

This is in response to Issue #1341 "Move from Circle CI to Github Actions".

I took heavy inspiration from the Prometheus implementation here: https://github.com/prometheus/prometheus/blob/main/.github/workflows/ci.yml

Implementation notes

New secrets are required

You must add the following secrets to be used in the ci.yml GitHub Action: https://github.com/prometheus/blackbox_exporter/settings/secrets/actions

DOCKER_HUB_LOGIN
DOCKER_HUB_PASSWORD
QUAY_IO_LOGIN
QUAY_IO_PASSWORD
PROMBOT_GITHUB_TOKEN

For my testing, I had to create my own secrets in my forked repository.

Removing skipped tests

In this pull request, I removed all skipped tests that were skipped due to "CI" and validated that they work fine.

Adding skip to TestChooseProtocol

As was called out in #1341, IPv6-related issues were ran into but they appeared to only fail TestChooseProtocol for Windows. I have adjusted the test to be skipped accordingly under those conditions. I feel this is fine as we are testing on 2 other OS's.

Testing

In order to test this, I forked the repository and made many commits to my master branch (as that's the branch that I had to apply Actions configurations to for GitHub to pick them up).

Here are the results, laid out by what condition was tested and what the outcome was:

Condition

Create new branch and publish to remote with changes.

Outcome

1 Github Action was triggered and it ran the Test job.


Condition

Create pull request of new branch to master.

Outcome

1 Github Action was triggered and it ran the Test and Build common architectures jobs.


Condition

Push change / merge pull request into master.

Outcome

1 GitHub Action was triggered and it ran the Test, Build all architectures, and Publish master jobs. DockerHub’s master tag was updated. Quay’s master tag was updated.


Condition

A release PR is created and merged into master. A tag for v0.30.0 is created:

~/workspace/repos/blackbox_exporter migrate_github_actions ❯ git tag -a v0.30.0 -m "v0.30.0"
~/workspace/repos/blackbox_exporter test_release_0.30.0 ❯ git push origin tag v0.30.0    
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 161 bytes | 161.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/Bryce-Souers/blackbox_exporter.git
 * [new tag]         v0.30.0 -> v0.30.0

Outcome

1 GitHub Action was triggered, and it ran the Test, Build all architectures, and Publish release jobs. A release for v0.30.0 was created. DockerHub’s master tag was updated. Quay’s master tag was updated.

bryce-souers avatar Jan 05 '25 02:01 bryce-souers

FYI, I have updated the Org shared secrets to included the required ENV vars for publishing.

SuperQ avatar Jan 08 '25 10:01 SuperQ

hi @bryce-souers, just checking in to see if you had time to address review comments. I would love to get this merged so let me know if you need help with anything :)

electron0zero avatar Feb 21 '25 12:02 electron0zero