Commit d5ef7a01 authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Refactor : run CI in concurrency with coverage

parent 8e60e1b4
Pipeline #7082 failed
......@@ -17,26 +17,11 @@ variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
stages:
- sonar-analysis
- build
stages:
- build-and-test-with-sonar-concurrently
sonarqube:
stage: sonar-analysis
image: skilldlabs/sonar-scanner:3.4.0
script:
- >
sonar-scanner
-Dsonar.projectName=${CI_PROJECT_NAME}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.projectBaseDir=.
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_TOKEN}
build-master:
stage: build
build-master:
stage: build-and-test-with-sonar-concurrently
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE" .
......@@ -44,11 +29,28 @@ build-master:
only:
- master
build:
stage: build
build:
stage: build-and-test-with-sonar-concurrently
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
sonarqube:
stage: build-and-test-with-sonar-concurrently
image: registry.forge.grandlyon.com/apoyen/sonnar-scanner-gl:master
script:
- go test ./... -coverprofile=coverage.out
- >
sonar-scanner
-Dsonar.projectName=${CI_PROJECT_NAME}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.projectBaseDir=.
-Dsonar.host.url=${SONAR_URL}
-Dsonar.projectKey=${SONAR_PROJECT_KEY}
-Dsonar.login=${SONAR_TOKEN}
-Dsonar.go.coverage.reportPaths=./coverage.out
-Dsonar.exclusions=**/*_test.go
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment