From 4fe6763faf645568b2d1d3fe4cdcfcf6b12cf7e6 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Sat, 21 Oct 2023 16:59:14 -0700 Subject: ci: Use golangci-lint for linting (#121) Instead of hand-managing and running linters, use golangci-lint. Along with the golangci-lint defaults, enable a couple other linters we generally agree with. See also uber-go/zap#1323 for a similar change. As a result of this, we can: - Drop the dependabot for tools - Run the lint job in parallel with build/test - Simplify the Makefile --- .github/workflows/go.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9c644e1..9c46b19 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,8 +23,8 @@ jobs: go-version: 1.21.x cache: true - - name: Lint - run: make lint + - name: Build + run: make build - name: Test run: make cover @@ -32,6 +32,28 @@ jobs: - name: Upload coverage to codecov.io uses: codecov/codecov-action@v3 + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + name: Check out repository + - uses: actions/setup-go@v4 + name: Set up Go + with: + go-version: 1.21.x + cache: false # managed by golangci-lint + + - uses: golangci/golangci-lint-action@v3 + name: Install golangci-lint + with: + version: latest + args: --version # make lint will run the linter + + - run: make lint + name: Lint + docker: runs-on: ubuntu-latest steps: -- cgit v1.2.3