From 8c5d824c049c47897c26830a14fa952cbdcfbad4 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 26 Aug 2021 10:27:05 +0200 Subject: [PATCH] chore(ci): use golangci-lint-action (#1477) Signed-off-by: Matthieu MOREL --- .github/workflows/Test.yml | 21 ++++++++++++++++----- Makefile | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 78edcb0af4..f94dd2c5f3 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -10,6 +10,20 @@ env: 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: strategy: @@ -41,7 +55,6 @@ jobs: - run: | 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 16|17) _version='@latest';; *) _version='';; @@ -49,8 +62,7 @@ jobs: go install github.com/kyoh86/richgo"${_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: name: MINGW64 @@ -83,8 +95,7 @@ jobs: - run: | 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/mitchellh/gox@latest - - run: PATH=$HOME/go/bin:$PATH make + - run: PATH=$HOME/go/bin:$PATH make test cobra_generator diff --git a/Makefile b/Makefile index 472c73bf16..5880f04eb4 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ lint: $(info ******************** running lint tools ********************) golangci-lint run -v -test: install_deps lint +test: install_deps $(info ******************** running tests ********************) richgo test -v ./...