From: kaliko Date: Fri, 18 Dec 2020 09:58:42 +0000 (+0100) Subject: Integrate pylint-gitlab and dependency scanning X-Git-Tag: 0.16.1~10 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=e20b5bb3d83ad8630f85163df308270b1d0189cd;p=mpd-sima.git Integrate pylint-gitlab and dependency scanning --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 484d151..9a39e13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,10 @@ # https://hub.docker.com/_/python image: python:3 +include: + - local: .gitlab/gitlab-templates.yml + - local: .gitlab/pylint.yml + variables: #XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache" diff --git a/.gitlab/gitlab-templates.yml b/.gitlab/gitlab-templates.yml new file mode 100644 index 0000000..7097e5f --- /dev/null +++ b/.gitlab/gitlab-templates.yml @@ -0,0 +1,2 @@ +include: + - template: Dependency-Scanning.gitlab-ci.yml diff --git a/.gitlab/pylint.yml b/.gitlab/pylint.yml new file mode 100644 index 0000000..9cffbfb --- /dev/null +++ b/.gitlab/pylint.yml @@ -0,0 +1,24 @@ +pylint: + stage: test + image: python:3.7-slim + before_script: + - mkdir -p public/badges public/lint + - echo undefined > public/badges/$CI_JOB_NAME.score + - pip install pylint_gitlab + script: + - pylint --exit-zero --output-format=text sima | tee /tmp/pylint.txt + - sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score + - pylint --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter sima > codeclimate.json + - pylint --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter sima > public/lint/index.html + after_script: + - anybadge --overwrite --label $CI_JOB_NAME --value=$(cat public/badges/$CI_JOB_NAME.score) --file=public/badges/$CI_JOB_NAME.svg 4=red 6=orange 8=yellow 10=green + - | + echo "Your score is: $(cat public/badges/$CI_JOB_NAME.score)" + artifacts: + expire_in: 30 days + paths: + - public + reports: + codequality: codeclimate.json + when: always +