-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit add Github Actions workflow for CI and golangci-lint configuration. Signed-off-by: Andreas Auernhammer <[email protected]>
- Loading branch information
Andreas Auernhammer
authored
May 6, 2021
1 parent
ae02134
commit 2535ed3
Showing
4 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Go | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Build Go ${{ matrix.go-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x, 1.16.x] | ||
steps: | ||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Build | ||
env: | ||
GO111MODULE: on | ||
run: | | ||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.33.0 | ||
$(go env GOPATH)/bin/golangci-lint run --config ./.golangci.yml | ||
go vet ./... | ||
test: | ||
name: Testing Go ${{ matrix.go-version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
go-version: [1.16.x] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Test on ${{ matrix.os }} | ||
env: | ||
GO111MODULE: on | ||
run: | | ||
go test ./... | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
linters-settings: | ||
golint: | ||
min-confidence: 0 | ||
|
||
misspell: | ||
locale: US | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- typecheck | ||
- goimports | ||
- misspell | ||
- govet | ||
- golint | ||
- ineffassign | ||
- gosimple | ||
- deadcode | ||
- unused | ||
- structcheck | ||
- prealloc | ||
- unconvert | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude: | ||
- should have a package comment | ||
- error strings should not be capitalized or end with punctuation or a newline | ||
- don't use ALL_CAPS in Go names | ||
service: | ||
golangci-lint-version: 1.33.0 # use the fixed version to not introduce new linters unexpectedly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters