From c91241abf61d2c8ae410eb6bb3154a3af9bc8f9e Mon Sep 17 00:00:00 2001 From: Manuel Kieweg <manuel.kieweg@h-da.de> Date: Tue, 6 Oct 2020 09:20:55 +0000 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30d61f939..a9acb2eaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,35 +12,34 @@ before_script: code-quality-master: image: golangci/golangci-lint:latest-alpine stage: test - only: - - merge_requests - except: - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master" + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + when: manual script: - - git config --global url."https://$GO_MODULES_USER:$GO_MODULES_ACCESS_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de" # writes golangci-lint output to gl-code-quality-report.json - - golangci-lint run --config .ci/.golangci-master.yml | tee gl-code-quality-report.json + - golangci-lint run --config .ci/.golangci-master.yml --out-format code-climate | tee gl-code-quality-report.json | jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"' artifacts: reports: codequality: gl-code-quality-report.json + paths: + - gl-code-quality-report.json code-quality: image: golangci/golangci-lint:latest-alpine stage: test allow_failure: true - only: - - merge_requests - except: - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH script: # writes golangci-lint output to gl-code-quality-report.json - - golangci-lint run --config .ci/.golangci.yml | tee gl-code-quality-report.json + - golangci-lint run --config .ci/.golangci.yml--out-format code-climate | tee gl-code-quality-report.json | jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"' artifacts: reports: codequality: gl-code-quality-report.json + paths: + - gl-code-quality-report.json Documentation: before_script: @@ -50,9 +49,9 @@ Documentation: entrypoint: - '' stage: build - only: - changes: - - documentation/design/*.md + rules: + - changes: + - documentation/design/*.md script: - cd documentation/design - pandoc --filter pandoc-citeproc --bibliography=bibliography.bib --csl=acm-sig-proceedings.csl @@ -78,4 +77,3 @@ include: - template: Security/SAST.gitlab-ci.yml - template: Dependency-Scanning.gitlab-ci.yml - template: Security/License-Scanning.gitlab-ci.yml - -- GitLab