Enable staticcheck in forgejo actions #490
2 changed files with 23 additions and 1 deletions
|
@ -52,3 +52,21 @@ jobs:
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test ./... -count=1 -race
|
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
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -135,8 +135,12 @@ pre-commit-run:
|
||||||
lint:
|
lint:
|
||||||
@golangci-lint --timeout=5m run
|
@golangci-lint --timeout=5m run
|
||||||
|
|
||||||
|
# Install staticcheck
|
||||||
|
staticcheck-install:
|
||||||
|
@go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||||
fyrchik marked this conversation as resolved
Outdated
fyrchik
commented
Why did you go with a separate target for this? Why did you go with a separate target for this?
acid-ant
commented
It was helpful to debug. Now there are no obstacles to merge it one target. How about one target for It was helpful to debug. Now there are no obstacles to merge it one target. How about one target for `install&run`?
Well, in some of my previous commits I made one target (install&run), there was a question whether it would work without the internet. Well, in some of my previous commits I made one target (install&run), there was a question whether it would work without the internet.
fyrchik
commented
I mean calling I mean calling `go install` directly vs Makefile target only for actions.
Probably it is better your way anyway.
|
|||||||
|
|
||||||
# Run staticcheck
|
# Run staticcheck
|
||||||
staticcheck:
|
staticcheck-run:
|
||||||
@staticcheck ./...
|
@staticcheck ./...
|
||||||
|
|
||||||
# Run linters in Docker
|
# Run linters in Docker
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue
The matrix is not needed here, we do not test staticcheck itself.
Updated.