Skip to content

Commit

Permalink
Use golangci-lint action in github
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Feb 28, 2022
1 parent ef1bf49 commit cdccc9b
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
lint:
runs-on: ubuntu-latest
env:
GO111MODULE: 'on'
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -54,16 +52,16 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Install golangci-lint
working-directory: /tmp
run: |
GOLANGCI_LINT_VERSION=$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')
go install "github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_LINT_VERSION"
- name: Run linters
- name: Retrieve golangci-lint version
run: |
BASEREV=$(git merge-base HEAD origin/master)
echo "Base revision: $BASEREV"
golangci-lint run --out-format=tab --new-from-rev "$BASEREV" ./...
echo "::set-output name=Version::$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')"
id: version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: ${{ steps.version.outputs.Version }}
only-new-issues: true

test-prev:
strategy:
Expand Down

0 comments on commit cdccc9b

Please sign in to comment.