Skip to content

Commit 7498824

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

File tree

3 files changed

+94
-36
lines changed

3 files changed

+94
-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: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
container:
11+
# Update Go version to match your CircleCI config
12+
image: cimg/go:1.23
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Run tests
18+
run: make
19+
20+
- name: Check for uncommitted changes
21+
run: git diff --exit-code
22+
23+
- name: Store artifact
24+
uses: actions/upload-artifact@v3
25+
with:
26+
name: statsd_exporter
27+
path: statsd_exporter
28+
29+
build:
30+
name: Build
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: prometheus/promci@v0.0.2
35+
- uses: ./.github/promci/actions/build
36+
37+
golangci:
38+
name: golangci-lint
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
- uses: actions/setup-go@v4
43+
with:
44+
go-version: '1.23'
45+
- name: Run golangci-lint
46+
uses: golangci/golangci-lint-action@v3
47+
with:
48+
version: v1.64.5
49+
50+
publish_master:
51+
name: Publish master branch artifacts
52+
runs-on: ubuntu-latest
53+
needs: [test, build]
54+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
55+
steps:
56+
- uses: actions/checkout@v3
57+
- uses: prometheus/promci@v0.0.2
58+
- uses: ./.github/promci/actions/publish_main
59+
with:
60+
docker_hub_login: ${{ secrets.DOCKER_HUB_LOGIN }}
61+
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
62+
63+
publish_release:
64+
name: Publish release artifacts
65+
runs-on: ubuntu-latest
66+
needs: [test, build]
67+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
68+
steps:
69+
- uses: actions/checkout@v3
70+
- uses: prometheus/promci@v0.0.2
71+
- uses: ./.github/promci/actions/publish_release
72+
with:
73+
docker_hub_login: ${{ secrets.DOCKER_HUB_LOGIN }}
74+
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
75+
github_token: ${{ secrets.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)