From a0d51090a4620beccb5a86b0808ef085c1f84f87 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 5 Jul 2023 11:57:16 +0300 Subject: [PATCH] [#482] Enable staticcheck in foregjo actions Signed-off-by: Anton Nikiforov --- .forgejo/workflows/tests.yml | 18 ++++++++++++++++++ Makefile | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml index 2d44d34f8..13395a64b 100644 --- a/.forgejo/workflows/tests.yml +++ b/.forgejo/workflows/tests.yml @@ -52,3 +52,21 @@ jobs: - name: Run tests run: go test ./... -count=1 -race + + staticcheck: + name: Staticcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + cache: true + + - name: Install staticcheck + run: make staticcheck-install + + - name: Run staticcheck + run: make staticcheck-run diff --git a/Makefile b/Makefile index e1b719206..df53b8772 100755 --- a/Makefile +++ b/Makefile @@ -135,8 +135,12 @@ pre-commit-run: lint: @golangci-lint --timeout=5m run +# Install staticcheck +staticcheck-install: + @go install honnef.co/go/tools/cmd/staticcheck@latest + # Run staticcheck -staticcheck: +staticcheck-run: @staticcheck ./... # Run linters in Docker