Skip to content
Snippets Groups Projects
Commit 085e937a authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Merge branch 'ci-go-vulnerability-check' into 'main'

Add Go vulnerability checks to CI pipeline

See merge request gaia-x/data-infrastructure-federation-services/tsa/cache!3
parents ba3fc517 a4cf9703
No related branches found
Tags v2.0.0
No related merge requests found
Pipeline #54574 passed with stages
in 1 minute and 19 seconds
......@@ -16,7 +16,7 @@ include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
lint:
image: golangci/golangci-lint:v1.44.2
image: golangci/golangci-lint:v1.50.0
stage: test
tags:
- amd64-docker
......@@ -28,13 +28,26 @@ lint:
- cd /go/src/gitlab.com/${CI_PROJECT_PATH}
unit tests:
image: golang:1.17.7
image: golang:1.19
extends: .gotest
stage: test
tags:
- amd64-docker
before_script: []
govulncheck:
image: golang:1.19
stage: test
tags:
- amd64-docker
before_script:
- ln -s /builds /go/src/gitlab.com
- cd /go/src/gitlab.com/${CI_PROJECT_PATH}
script:
- go version
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
amd64:
extends: .docker-build
stage: build
......
......@@ -12,7 +12,6 @@ linters:
enable:
- megacheck
- govet
- deadcode
- errcheck
- goconst
- gocyclo
......@@ -22,10 +21,9 @@ linters:
- ineffassign
- nakedret
- staticcheck
- structcheck
- unconvert
- varcheck
- vet
- vetshadow
- misspell
- staticcheck
- unused
......@@ -171,7 +171,7 @@ func exposeMetrics(addr string, logger *zap.Logger) {
promMux := http.NewServeMux()
promMux.Handle("/metrics", promhttp.Handler())
logger.Info(fmt.Sprintf("exposing prometheus metrics at %s/metrics", addr))
if err := http.ListenAndServe(addr, promMux); err != nil {
if err := http.ListenAndServe(addr, promMux); err != nil { //nolint:gosec
logger.Error("error exposing prometheus metrics", zap.Error(err))
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment