Add golangci-lint support to Gitlab CI.

errwrp
Martin Dosch 1 year ago
parent 8f844b1cde
commit 48cc826d33
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

@ -5,6 +5,7 @@
image: golang:latest
variables:
# Please edit to your GitLab project
REPO_NAME: salsa.debian.org/mdosch/go-sendxmpp
@ -26,11 +27,17 @@ stages:
- release
format:
image: registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
stage: test
script:
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)
# Taken from https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20404/diffs#diff-content-8071267ea32ba69f24a8bd50bcbddf972c295ce3
# Use default .golangci.yml file from the image if one is not present in the project root.
- '[ -e .golangci.yml ] || cp /golangci/.golangci.yml .'
- golangci-lint run --out-format code-climate
allow_failure: true
compile:
stage: build

Loading…
Cancel
Save