diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c7e0872d48dd17b0337193ffca005a266ad57f0..b84f14e953ca755cf6455abe8427abc9ffb55610 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,81 +1,10 @@ include: - project: '${HELPERS_PATH}' - file: svdh-cicd.yml + file: + - cicd-template.yml + - go-template.yml variables: - RUNNER_AMD: amd64-docker - DOCKER_FILE: ./deployment/ci/Dockerfile + RUNNER_TAG: amd64-docker GO_VERSION: 1.22.4 - -stages: - - test - - build - - trigger-deploy -lint: - image: golangci/golangci-lint:latest - stage: test - tags: - - amd64-docker - script: - - golangci-lint --version - - golangci-lint run - before_script: - - ln -s /builds /go/src/code.vereign.com - - cd /go/src/code.vereign.com/${CI_PROJECT_PATH} - -unit tests: - image: golang:${GO_VERSION} - extends: .gotest - stage: test - tags: - - amd64-docker - before_script: [] - coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/' - -govulncheck: - image: golang:${GO_VERSION} - stage: test - tags: - - amd64-docker - before_script: - - ln -s /builds /go/src/code.vereign.com - - cd /go/src/code.vereign.com/${CI_PROJECT_PATH} - script: - - go version - - go install golang.org/x/vuln/cmd/govulncheck@latest - - govulncheck ./... - -build-dev: - extends: .docker-build-dev - stage: build - tags: - - $RUNNER_AMD - rules: - # Only run if the branch is not main, the pipeline is not triggered by a merge request and the commit is not a tag - - if: '$CI_COMMIT_BRANCH != "main" && $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_TAG == null' - -build-stg: - extends: .docker-build-dev - stage: build - tags: - - $RUNNER_AMD - rules: - - if: '$CI_COMMIT_TAG' - -deploy-dev: - extends: .deploy-dev - stage: trigger-deploy - needs: - - job: build-dev - rules: - # Only run if the branch is not main, the pipeline is not triggered by a merge request and the commit is not a tag - - if: '$CI_COMMIT_BRANCH != "main" && $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_TAG == null' - - -deploy-stg: - extends: .deploy-stg - stage: trigger-deploy - needs: - - job: build-stg - rules: - - if: '$CI_COMMIT_TAG' \ No newline at end of file + GOLANGCI_LINT_VERSION: latest \ No newline at end of file