-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from jacobbednarz/golint-swap
cleanup CI
- Loading branch information
Showing
5 changed files
with
62 additions
and
21 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,19 @@ | ||
name: Lint | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
jobs: | ||
golangci-lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: "--config .golintci.yaml" |
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 |
---|---|---|
@@ -1,29 +1,19 @@ | ||
on: [push, pull_request] | ||
on: [pull_request] | ||
name: Test | ||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.18, 1.19] | ||
go-version: [1.17, 1.18, 1.19] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
- name: Format | ||
run: gofmt -d . | ||
- name: Lint | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
go get -v -u golang.org/x/lint/golint | ||
$(go env GOPATH)/bin/golint -set_exit_status . | ||
- name: Vet | ||
run: go vet $(go list ./... | grep -v /vendor/) | ||
- name: Test | ||
- name: test | ||
run: go test -v -race ./... |
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,32 @@ | ||
run: | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 1m | ||
|
||
# exit code when at least one issue was found, default is 1 | ||
issues-exit-code: 1 | ||
|
||
# include test files or not, default is true | ||
tests: true | ||
|
||
# default is true. Enables skipping of directories: | ||
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ | ||
skip-dirs-use-default: true | ||
|
||
modules-download-mode: readonly | ||
|
||
linters: | ||
enable: | ||
- bodyclose # ensure HTTP response bodies are successfully closed. | ||
- contextcheck # check we are passing context an inherited context. | ||
- gofmt # checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification. | ||
- errname # checks that sentinel errors are prefixed with the `Err`` and error types are suffixed with the `Error``. | ||
- errorlint # used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. | ||
- godot # check if comments end in a period. | ||
- misspell # finds commonly misspelled English words in comments. | ||
- nilerr # checks that there is no simultaneous return of nil error and an invalid value. | ||
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes. | ||
- unparam # reports unused function parameters. | ||
- whitespace # detection of leading and trailing whitespace. | ||
|
||
output: | ||
format: colored-line-number |
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