Skip to content

Commit

Permalink
Update CI and linter (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 25, 2024
1 parent 7c15727 commit 115422b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 32 deletions.
38 changes: 16 additions & 22 deletions .github/workflows/go.yml
Expand Up @@ -9,11 +9,11 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: actions/checkout@v3
- uses: golangci/golangci-lint-action@v3
go-version: stable
- uses: golangci/golangci-lint-action@v4

tests:
# run after golangci-lint action to not produce duplicated errors
Expand All @@ -22,40 +22,34 @@ jobs:
strategy:
matrix:
go:
- '1.20'
- oldstable
- stable
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup cache
uses: actions/cache@v3
- name: Install Go
uses: actions/setup-go@v5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
go-version: ${{ matrix.go }}

- name: Test code
run: go test -race -v ./...

coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
- name: Checkout code
if: success()
uses: actions/setup-go@v3
with:
go-version: '1.20'
uses: actions/checkout@v4

- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Calc coverage
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -68,3 +68,5 @@ tags


# End of https://www.gitignore.io/api/go,vim,macos

.idea/
19 changes: 9 additions & 10 deletions .golangci.yml
@@ -1,24 +1,25 @@
---
run:
deadline: 1m
timeout: 1m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor$

output:
format: colored-line-number
print-issued-lines: false
sort-results: true
formats:
- format: colored-line-number

linters-settings:
gocognit:
min-complexity: 10

depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/davecgh/go-spew/spew
rules:
main:
deny:
- pkg: "github.com/davecgh/go-spew/spew"
desc: not allowed

misspell:
locale: US
Expand Down Expand Up @@ -70,8 +71,6 @@ linters:
- varcheck
- varnamelen
- wastedassign
fast: false


issues:
exclude-use-default: true
Expand Down

0 comments on commit 115422b

Please sign in to comment.