Skip to content

Commit f51c693

Browse files
authored
feat(ci): moving to actions (prometheus-community#3)
* feat(ci): moving to actions Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix: lint Signed-off-by: Carlos Alexandro Becker <[email protected]>
1 parent ac5146c commit f51c693

26 files changed

+131
-301
lines changed

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/setup-go@v2
16+
with:
17+
go-version: ~1.16
18+
- uses: actions/checkout@v2
19+
- name: golangci-lint
20+
uses: golangci/golangci-lint-action@v2
21+
with:
22+
skip-go-installation: true

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
-
21+
name: Set up Go
22+
uses: actions/setup-go@v2
23+
with:
24+
go-version: 1.16
25+
-
26+
name: Cache Go modules
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/go/pkg/mod
30+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
31+
restore-keys: |
32+
${{ runner.os }}-go-
33+
-
34+
name: CI
35+
run: |
36+
go mod tidy
37+
go test -v ./...
38+
go build -o tt .
39+
-
40+
name: Run GoReleaser
41+
uses: goreleaser/goreleaser-action@v2
42+
if: success() && startsWith(github.ref, 'refs/tags/')
43+
with:
44+
version: latest
45+
args: release --rm-dist
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
linters:
2+
enable:
3+
- thelper
4+
- gofumpt
5+
- tparallel
6+
- unconvert
7+
- unparam
8+
- wastedassign
9+
- revive

.gometalinter.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

.promu.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 80 deletions
This file was deleted.

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

collector/cluster_health.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func (c *ClusterHealth) fetchAndDecodeClusterHealth() (clusterHealthResponse, er
271271

272272
// Collect collects ClusterHealth metrics.
273273
func (c *ClusterHealth) Collect(ch chan<- prometheus.Metric) {
274-
var now = time.Now()
274+
now := time.Now()
275275
var err error
276276
c.totalScrapes.Inc()
277277
defer func() {

0 commit comments

Comments
 (0)