diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0d92907b11ec36a6dd9ff8414590c9467c38dcf..60bc720bc15742202308679282562c5aede6c951 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,11 +8,22 @@ run_tests: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' stage: test script: - - go fmt ./... - - go vet ./... - go install gotest.tools/gotestsum@latest - - gotestsum --format testname --junitfile report.xml + - gotestsum --format testname --junitfile report.xml artifacts: when: always reports: junit: report.xml + +lint: + image: golangci/golangci-lint:v1.55-alpine + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + stage: test + script: + - golangci-lint run --issues-exit-code 1 --print-issued-lines=false --new-from-rev $CI_MERGE_REQUEST_DIFF_BASE_SHA --out-format code-climate:gl-code-quality-report.json,line-number + artifacts: + reports: + codequality: gl-code-quality-report.json + paths: + - gl-code-quality-report.json