diff options
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 638f916..e351fd1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,33 @@ -.test: &test_definition +variables: + DOCKER_VERSION: "19.03.0" + +workflow: + rules: + # For merge requests, create a pipeline. + - if: '$CI_MERGE_REQUEST_IID' + # For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.). + - if: '$CI_COMMIT_BRANCH == "master"' + # For tags, create a pipeline. + - if: '$CI_COMMIT_TAG' + +default: + image: golang:1.12 + tags: + - gitlab-org + +.use-docker-in-docker: + image: docker:${DOCKER_VERSION} + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://docker:2375 + DOCKER_TLS_CERTDIR: "" + tags: + # See https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/7019 for tag descriptions + - gitlab-org-docker + +.test: before_script: # Set up the environment to run integration tests (still written in Ruby) - apt-get update -qq && apt-get install -y ruby ruby-dev @@ -15,25 +44,20 @@ - make verify test go:1.12: - <<: *test_definition + extends: .test image: golang:1.12 go:1.13: - <<: *test_definition + extends: .test image: golang:1.13 go:1.14: - <<: *test_definition + extends: .test image: golang:1.14 codequality: - image: docker:stable - variables: - DOCKER_DRIVER: overlay2 + extends: .use-docker-in-docker allow_failure: true - services: - - docker:stable-dind - before_script: [] script: - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - docker run @@ -45,13 +69,8 @@ codequality: paths: [codeclimate.json] sast: - image: docker:stable - variables: - DOCKER_DRIVER: overlay2 + extends: .use-docker-in-docker allow_failure: true - services: - - docker:stable-dind - before_script: [] script: - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - docker run @@ -63,13 +82,8 @@ sast: paths: [gl-sast-report.json] dependency_scanning: - image: docker:stable - variables: - DOCKER_DRIVER: overlay2 + extends: .use-docker-in-docker allow_failure: true - services: - - docker:stable-dind - before_script: [] script: - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - docker run @@ -93,4 +107,3 @@ code_navigation: artifacts: paths: - lsif/ - |