Skip to content

Commit bedbab3

Browse files
authored
Use GitHub actions for testing and linting (#3)
Use golangci-lint to coordinate linting instead of installing tools individually. The workflow installs the binary directly instead of using one of the existing public actions.
1 parent 09f3004 commit bedbab3

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/go.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Go
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
verify:
9+
name: Verify
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Set up Go 1.13
13+
uses: actions/setup-go@v1
14+
with:
15+
go-version: 1.13
16+
id: go
17+
18+
- name: Set up environment
19+
run: |
20+
# https://github.com/actions/setup-go/issues/14
21+
echo "::set-env name=GOPATH::$(go env GOPATH)"
22+
echo "::add-path::$(go env GOPATH)/bin"
23+
24+
- name: Install golangci-lint
25+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.1
26+
27+
- name: Check out code into the Go module directory
28+
uses: actions/checkout@v1
29+
30+
- name: Lint
31+
run: golangci-lint run
32+
33+
- name: Test
34+
run: go test -v ./...
35+

.golangci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
run:
2+
tests: false
3+
4+
linters:
5+
disable-all: true
6+
enable:
7+
- deadcode
8+
- errcheck
9+
- gofmt
10+
- goimports
11+
- golint
12+
- govet
13+
- ineffassign
14+
- typecheck
15+
- unconvert
16+
- varcheck
17+
18+
issues:
19+
exclude-use-default: false
20+
21+
linter-settings:
22+
goimports:
23+
local-prefixes: github.com/bluekeyes/go-gitdiff

0 commit comments

Comments
 (0)