go-tools
go-tools copied to clipboard
Documentation for GitLab CICD in the Continuous Integration page
Hey guys, I love your work but it would be really helpful to have a sub-page for GitLab CICD. It's broadly use.
Currently there's only documentation for GitHub Action: https://staticcheck.dev/docs/running-staticcheck/ci/
Thanks in advance
I crafted that out of some random google search:
stages:
- validate
go:staticcheck:
image: golang:latest
stage: validate
script:
- go install honnef.co/go/tools/cmd/staticcheck@latest
- $GOPATH/bin/staticcheck -checks all ./...
allow_failure: true
As I found out the json format reported from staticcheck is not recognized by gitlab-ci, as it is mentioned in the GitLab.
I added a go package that converts the output to a Gitlab known format so that the report is shown on the MR. You can check this repo: https://github.com/miare-ir/staticcheck-gitlab-ci