Skip to content

Commit 442edda

Browse files
committed
trying move to gh actions
Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com>
1 parent 36a8751 commit 442edda

File tree

3 files changed

+97
-36
lines changed

3 files changed

+97
-36
lines changed

.circleci/config.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,31 @@
1+
# This project has switched to GitHub Actions.
2+
# CircleCI is not disabled repository-wise so that previous pull requests
3+
# continue working.
4+
# This file does not generate any CircleCI workflow.
5+
16
version: 2.1
2-
orbs:
3-
prometheus: prometheus/prometheus@0.17.1
7+
48
executors:
5-
# Whenever the Go version is updated here, .promu.yml should also be updated.
69
golang:
710
docker:
8-
- image: cimg/go:1.23
11+
- image: busybox
12+
913
jobs:
10-
test:
14+
noopjob:
1115
executor: golang
1216
steps:
13-
- prometheus/setup_environment
14-
- run: make
15-
- run: git diff --exit-code
16-
- prometheus/store_artifact:
17-
file: statsd_exporter
17+
- run:
18+
command: "true"
19+
1820
workflows:
1921
version: 2
2022
statsd_exporter:
2123
jobs:
22-
- test:
24+
- noopjob
25+
triggers:
26+
- schedule:
27+
cron: "0 0 30 2 *"
2328
filters:
24-
tags:
25-
only: /.*/
26-
- prometheus/build:
27-
name: build
28-
filters:
29-
tags:
30-
only: /.*/
31-
- prometheus/publish_master:
32-
context: org-context
33-
requires:
34-
- test
35-
- build
36-
filters:
37-
branches:
38-
only: master
39-
- prometheus/publish_release:
40-
context: org-context
41-
requires:
42-
- test
43-
- build
44-
filters:
45-
tags:
46-
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
4729
branches:
48-
ignore: /.*/
30+
only:
31+
- master

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
on: # yamllint disable-line rule:truthy
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
# Whenever the Go version is updated here, .promu.yml
11+
# should also be updated.
12+
container:
13+
image: quay.io/prometheus/golang-builder:1.23-base
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: prometheus/promci@v0.0.2
17+
- uses: ./.github/promci/actions/setup_environment
18+
- run: make SKIP_GOLANGCI_LINT=1
19+
20+
build:
21+
name: Build
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
thread: [ 0, 1, 2, 3, 4, 5 ]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: prometheus/promci@v0.0.2
29+
- uses: ./.github/promci/actions/build
30+
with:
31+
parallelism: 6
32+
thread: ${{ matrix.thread }}
33+
34+
golangci:
35+
name: golangci-lint
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
- name: Install Go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: '1.23.x'
44+
- name: Lint
45+
uses: golangci/golangci-lint-action@v4
46+
with:
47+
version: v1.64.5
48+
49+
publish_main:
50+
name: Publish main branch artifacts
51+
runs-on: ubuntu-latest
52+
needs: [test, build]
53+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: prometheus/promci@v0.0.2
57+
- uses: ./.github/promci/actions/publish_main
58+
with:
59+
docker_hub_login: ${{ secrets.docker_hub_login }}
60+
docker_hub_password: ${{ secrets.docker_hub_password }}
61+
quay_io_login: ${{ secrets.quay_io_login }}
62+
quay_io_password: ${{ secrets.quay_io_password }}
63+
64+
publish_release:
65+
name: Publish release artifacts
66+
runs-on: ubuntu-latest
67+
needs: [test, build]
68+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: prometheus/promci@v0.0.2
72+
- uses: ./.github/promci/actions/publish_release
73+
with:
74+
docker_hub_login: ${{ secrets.docker_hub_login }}
75+
docker_hub_password: ${{ secrets.docker_hub_password }}
76+
quay_io_login: ${{ secrets.quay_io_login }}
77+
quay_io_password: ${{ secrets.quay_io_password }}
78+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/prometheus/statsd_exporter
22

3-
go 1.22
3+
go 1.23
44

55
require (
66
github.com/alecthomas/kingpin/v2 v2.4.0

0 commit comments

Comments
 (0)