mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
chore(ci): use golangci-lint-action (#1477)
Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
This commit is contained in:
parent
1beb476da9
commit
ff2c55e323
2 changed files with 17 additions and 6 deletions
|
@ -9,6 +9,20 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
golangci-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: '1.17'
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: --verbose
|
||||||
|
|
||||||
test-unix:
|
test-unix:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -40,7 +54,6 @@ jobs:
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
export GOBIN=$HOME/go/bin
|
export GOBIN=$HOME/go/bin
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOBIN latest
|
|
||||||
case "${{ matrix.go }}" in
|
case "${{ matrix.go }}" in
|
||||||
16|17) _version='@latest';;
|
16|17) _version='@latest';;
|
||||||
*) _version='';;
|
*) _version='';;
|
||||||
|
@ -48,8 +61,7 @@ jobs:
|
||||||
go install github.com/kyoh86/richgo"${_version}"
|
go install github.com/kyoh86/richgo"${_version}"
|
||||||
go install github.com/mitchellh/gox"${_version}"
|
go install github.com/mitchellh/gox"${_version}"
|
||||||
|
|
||||||
- run: PATH=$HOME/go/bin/:$PATH make
|
- run: PATH=$HOME/go/bin/:$PATH make test cobra_generator
|
||||||
|
|
||||||
|
|
||||||
test-win:
|
test-win:
|
||||||
name: MINGW64
|
name: MINGW64
|
||||||
|
@ -82,8 +94,7 @@ jobs:
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
export GOBIN=$HOME/go/bin
|
export GOBIN=$HOME/go/bin
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOBIN latest
|
|
||||||
go install github.com/kyoh86/richgo@latest
|
go install github.com/kyoh86/richgo@latest
|
||||||
go install github.com/mitchellh/gox@latest
|
go install github.com/mitchellh/gox@latest
|
||||||
|
|
||||||
- run: PATH=$HOME/go/bin:$PATH make
|
- run: PATH=$HOME/go/bin:$PATH make test cobra_generator
|
2
Makefile
2
Makefile
|
@ -23,7 +23,7 @@ lint:
|
||||||
$(info ******************** running lint tools ********************)
|
$(info ******************** running lint tools ********************)
|
||||||
golangci-lint run -v
|
golangci-lint run -v
|
||||||
|
|
||||||
test: install_deps lint
|
test: install_deps
|
||||||
$(info ******************** running tests ********************)
|
$(info ******************** running tests ********************)
|
||||||
richgo test -v ./...
|
richgo test -v ./...
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue