From 069f71b98616d6fcb18d07ad79d53e3537d27a3e Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sun, 2 Nov 2025 11:28:38 +0100 Subject: [PATCH] Migrate to GitHub Actions Migrate CircleCI config to GitHub Actions. Signed-off-by: SuperQ --- .circleci/config.yml | 84 ++++++++-------------------------------- .github/dependabot.yml | 8 ++++ .github/workflows/ci.yml | 59 ++++++++++++++++++++++++++++ .gitignore | 1 + 4 files changed, 85 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 13aeee84..c9b1748b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,83 +1,33 @@ --- +# Prometheus has switched to GitHub action. +# Circle CI is not disabled repository-wise so that previous pull requests +# continue working. +# This file does not generate any CircleCI workflow. + version: 2.1 executors: - # Whenever the Go version is updated here, .promu.yml should also be updated. golang: docker: - - image: cimg/go:1.26 + - image: busybox jobs: - test: - executor: golang - - steps: - - setup_remote_docker - - checkout - - run: go build -o promu-intermediate - - run: make check_license style unused lint test build PROMU=./promu-intermediate - - store_artifacts: - path: promu - destination: /build/promu - - run: rm -v promu promu-intermediate - - run: git diff --exit-code - - build: - executor: golang - environment: - PROMU: ./promu-intermediate - working_directory: /home/circleci/.go_workspace/src/github.com/prometheus/promu - parallelism: 5 - - steps: - - setup_remote_docker - - checkout - - run: go build -o promu-intermediate - - run: ./promu-intermediate crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX - - persist_to_workspace: - root: . - paths: - - .build - - store_artifacts: - path: .build - destination: /build - - release_tags: + noopjob: executor: golang - environment: - PROMU: ./promu-intermediate steps: - - checkout - - attach_workspace: - at: . - - run: go build -o promu-intermediate - - run: ./promu-intermediate crossbuild tarballs - - run: ./promu-intermediate checksum .tarballs - - run: ./promu-intermediate release .tarballs - - store_artifacts: - path: .tarballs - destination: releases + - run: + command: "true" workflows: version: 2 promu: jobs: - - test: - filters: - tags: - only: /.*/ - - build: - filters: - tags: - only: /.*/ - - release_tags: - context: org-context - requires: - - test - - build - filters: - tags: - only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/ - branches: - ignore: /.*/ + - noopjob + triggers: + - schedule: + cron: "0 0 30 2 *" + filters: + branches: + only: + - main diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 202ae236..76e99715 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,11 @@ updates: directory: "/" schedule: interval: "monthly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + # Exclude configs synced from upstream prometheus/prometheus. + exclude-paths: + - .github/workflows/container_description.yml + - .github/workflows/golangci-lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..313eeeed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: + push: + tags: + - 'v*' + branches: + - master + pull_request: + workflow_call: + +jobs: + test_go: + name: Go tests + runs-on: ubuntu-latest + env: + PROMU: ./promu-intermediate + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Install Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: 1.26.x + - run: go build -o promu-intermediate + - run: make check_license style unused lint test build + - run: rm -v promu promu-intermediate + - run: git diff --exit-code + + build: + name: Build for common architectures + runs-on: ubuntu-latest + env: + PROMU: ./promu-intermediate + strategy: + matrix: + thread: [ 0, 1, 2, 3] + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Install Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: 1.26.x + - run: go build -o promu-intermediate + - run: ./promu-intermediate crossbuild -v --parallelism 4 --parallelism-thread ${{ matrix.thread }} + - uses: prometheus/promci-artifacts/save@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 + + publish_release: + name: Publish release artifacts + runs-on: ubuntu-latest + needs: [test_go, build] + if: | + (github.repository == 'prometheus/promu') + && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: prometheus/promci/publish_release@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0 + with: + github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9d1ce3c6..2bed70d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /promu +/promu-intermediate .build .tarballs testoutput