diff options
-rw-r--r-- | .gitlab-ci.yml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b3d50d..3c830e6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ --- + stages: - test + - validate test: image: golang:alpine @@ -10,3 +12,28 @@ test: - go test -v ./... tags: - linux + +validate: + image: golang:alpine + stage: test + script: | + apk add build-base git + go version + go env + + go install honnef.co/go/tools/cmd/staticcheck@latest + go install github.com/securego/gosec/v2/cmd/gosec@latest + + export PATH=$(go env GOPATH)/bin:$PATH + + go vet ./... + gofmt -s -l . && [ -z "$(gofmt -s -l .)" ] + + # See: https://staticcheck.io/docs/checks + staticcheck -checks inherit,ST1000,ST1016,ST1020,ST1021,ST1022,ST1023 ./... + # gosec does not handle modules correctly. + # See: https://github.com/securego/gosec/issues/622 + gosec -exclude-dir=obfsproxy ./... + + go mod tidy + git diff --exit-code -- go.mod go.sum |