go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

Documentation for GitLab CICD in the Continuous Integration page

Open marcottedan opened this issue 2 years ago • 2 comments

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

marcottedan avatar Jan 11 '23 21:01 marcottedan

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

marcottedan avatar Jan 11 '23 21:01 marcottedan

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

partizaans avatar Mar 11 '23 07:03 partizaans