Change trigger rules for CQ

This should fix the failed to load CQ Report issue on MRs
Also add links to tools used
This commit is contained in:
Zedifus 2022-06-10 14:48:00 +01:00
parent 087e28c1fc
commit 3081877c5f

View File

@ -1,54 +1,54 @@
# YAML Linting
# YAML Linting [https://yamllint.readthedocs.io/en/latest/]
yamllint:
stage: lint
image: registry.gitlab.com/pipeline-components/yamllint:latest
tags:
- docker
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
- if: "$CODE_QUALITY_DISABLED"
when: never
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH"
script:
- yamllint .
# JSON Linting
# JSON Linting [https://github.com/zaach/jsonlint]
jsonlint:
stage: lint
image: registry.gitlab.com/pipeline-components/jsonlint:latest
tags:
- docker
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
- if: "$CODE_QUALITY_DISABLED"
when: never
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH"
script:
- |
find . -not -path './.git/*' -name '*.json' -type f -print0 |
parallel --will-cite -k -0 -n1 jsonlint -q
# Code Format Checking
# Code Format Checking [https://black.readthedocs.io/en/stable/]
black:
stage: lint
image: registry.gitlab.com/pipeline-components/black:latest
tags:
- docker
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
- if: "$CODE_QUALITY_DISABLED"
when: never
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH"
script:
- black --check --verbose -- .
# Code Climate/Quality Checking
# Code Climate/Quality Checking [https://pylint.pycqa.org/en/latest/]
pylint:
stage: lint
image: registry.gitlab.com/pipeline-components/pylint:latest
tags:
- docker
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
- if: "$CODE_QUALITY_DISABLED"
when: never
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH"
before_script:
- mkdir -p public/badges public/lint
- echo undefined > public/badges/$CI_JOB_NAME.score