Skip to content

Commit ba6fcfb

Browse files
committed
Switch to GitHub workflows
1 parent 1b809a6 commit ba6fcfb

File tree

7 files changed

+179
-37
lines changed

7 files changed

+179
-37
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
strategy:
7+
matrix:
8+
go-version: [~1.12, ^1]
9+
os: [ubuntu-latest, macos-latest, windows-latest]
10+
runs-on: ${{ matrix.os }}
11+
env:
12+
GO111MODULE: "on"
13+
steps:
14+
- name: Install Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: ${{ matrix.go-version }}
18+
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Download Go modules
23+
run: go mod download
24+
25+
- name: Build
26+
run: go build -v ./...
27+
28+
- name: Test
29+
run: go test ./...

.github/workflows/coverage.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: coverage
2+
on: [push, pull_request]
3+
4+
jobs:
5+
coverage:
6+
strategy:
7+
matrix:
8+
go-version: [^1]
9+
os: [ubuntu-latest]
10+
runs-on: ${{ matrix.os }}
11+
env:
12+
GO111MODULE: "on"
13+
steps:
14+
- name: Install Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: ${{ matrix.go-version }}
18+
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Coverage
23+
env:
24+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
run: |
26+
go test -race -covermode atomic -coverprofile=profile.cov ./...
27+
GO111MODULE=off go get github.com/mattn/goveralls
28+
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github

.github/workflows/lint-soft.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: lint-soft
2+
on:
3+
push:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
9+
pull-requests: read
10+
11+
jobs:
12+
golangci:
13+
name: lint-soft
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: golangci-lint
18+
uses: golangci/golangci-lint-action@v2
19+
with:
20+
# Optional: golangci-lint command line arguments.
21+
args: --config .golangci-soft.yml --issues-exit-code=0
22+
# Optional: show only new issues if it's a pull request. The default value is `false`.
23+
only-new-issues: true

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: lint
2+
on:
3+
push:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
9+
pull-requests: read
10+
11+
jobs:
12+
golangci:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: golangci-lint
18+
uses: golangci/golangci-lint-action@v2
19+
with:
20+
# Optional: golangci-lint command line arguments.
21+
#args:
22+
# Optional: show only new issues if it's a pull request. The default value is `false`.
23+
only-new-issues: true

.golangci-soft.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
run:
2+
tests: false
3+
4+
issues:
5+
include:
6+
- EXC0001
7+
- EXC0005
8+
- EXC0011
9+
- EXC0012
10+
- EXC0013
11+
12+
max-issues-per-linter: 0
13+
max-same-issues: 0
14+
15+
linters:
16+
enable:
17+
# - dupl
18+
- exhaustive
19+
# - exhaustivestruct
20+
- goconst
21+
- godot
22+
- godox
23+
- gomnd
24+
- gomoddirectives
25+
- goprintffuncname
26+
- ifshort
27+
# - lll
28+
- misspell
29+
- nakedret
30+
- nestif
31+
- noctx
32+
- nolintlint
33+
- prealloc
34+
- wrapcheck
35+
36+
# disable default linters, they are already enabled in .golangci.yml
37+
disable:
38+
- deadcode
39+
- errcheck
40+
- gosimple
41+
- govet
42+
- ineffassign
43+
- staticcheck
44+
- structcheck
45+
- typecheck
46+
- unused
47+
- varcheck

.golangci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
run:
2+
tests: false
3+
4+
issues:
5+
include:
6+
- EXC0001
7+
- EXC0005
8+
- EXC0011
9+
- EXC0012
10+
- EXC0013
11+
12+
max-issues-per-linter: 0
13+
max-same-issues: 0
14+
15+
linters:
16+
enable:
17+
- bodyclose
18+
- exportloopref
19+
- goimports
20+
- gosec
21+
- nilerr
22+
- predeclared
23+
- revive
24+
- rowserrcheck
25+
- sqlclosecheck
26+
- tparallel
27+
- unconvert
28+
- unparam
29+
- whitespace

.travis.yml

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

0 commit comments

Comments
 (0)