Skip to content

Commit ae8a23e

Browse files
committed
meta: use moov-io/infra Go linter script in CI
1 parent 51e2e87 commit ae8a23e

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.github/workflows/test.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ jobs:
2323
- name: Check out code into the Go module directory
2424
uses: actions/checkout@v2
2525

26-
- name: Install Tools
26+
- name: Test (Unix)
27+
if: runner.os != 'Windows'
2728
run: |
28-
go install golang.org/x/lint/golint@latest
29+
make check
2930
30-
- name: Test
31+
- name: Test (Windows)
32+
if: runner.os == 'Windows'
3133
run: |
3234
go vet ./...
33-
golint ./...
34-
go test -cover -v ./...
35+
go test -v ./...

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ _testmain.go
2222
*.exe
2323
*.test
2424
*.prof
25+
26+
/lint-project.sh

makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: check
2+
check:
3+
ifeq ($(OS),Windows_NT)
4+
@echo "Skipping checks on Windows, currently unsupported."
5+
else
6+
@wget -O lint-project.sh https://raw.githubusercontent.com/moov-io/infra/master/go/lint-project.sh
7+
@chmod +x ./lint-project.sh
8+
COVER_THRESHOLD=75.0 ./lint-project.sh
9+
endif
10+
11+
.PHONY: clean
12+
clean:
13+
@rm -rf ./bin/ ./tmp/ coverage.txt misspell* staticcheck lint-project.sh
14+
15+
.PHONY: cover-test cover-web
16+
cover-test:
17+
go test -coverprofile=cover.out ./...
18+
cover-web:
19+
go tool cover -html=cover.out

0 commit comments

Comments
 (0)