Skip to content

Commit dea79a5

Browse files
committed
Add gh action for checks and tests
1 parent 59c1b71 commit dea79a5

File tree

3 files changed

+18
-130
lines changed

3 files changed

+18
-130
lines changed

.drone.yml

-115
This file was deleted.

.github/workflows/go.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
name: Go
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
[push]
85

96
jobs:
107

11-
build:
8+
test:
129
runs-on: ubuntu-latest
1310
steps:
1411
- uses: actions/checkout@v3
@@ -18,11 +15,21 @@ jobs:
1815
with:
1916
go-version: 1.21
2017

21-
- name: Build
22-
run: go build -v ./...
23-
2418
- name: Test
25-
run: go test ./...
19+
run: make test
2620

2721
- name: Benchmark
2822
run: go test -v -run=XXX -benchmem -bench=. ./...
23+
24+
checks:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v3
31+
with:
32+
go-version: 1.21
33+
34+
- name: Checks
35+
run: make checks

Makefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ benchmark:
1818

1919
checks:
2020
go vet ${PKGS}
21-
staticcheck ${PKGS}
21+
go run honnef.co/go/tools/cmd/staticcheck@latest ${PKGS}
2222
make lint
2323

2424
lint:
25-
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -c .golangci.yml -v
26-
27-
drone:
28-
drone lint .drone.yml --trusted
29-
drone sign grafana/unused --save
25+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -c .golangci.yml
3026

3127
docker:
3228
docker build --build-arg=GIT_VERSION=$(GIT_VERSION) -t $(IMAGE_PREFIX)/unused -f Dockerfile.exporter .

0 commit comments

Comments
 (0)