From eb0ad4d432ac4ab2680f1f677d28ebc3ed73f63c Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 16 Apr 2018 22:27:32 +0900 Subject: .gitlab-ci.yml: Perform some python code analysis with radon This adds a new job in the prepare stage which can be viewed in the gitlab CI, and also produces an artifacts with the json metrics. --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f7def9c4d..215d407cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,6 +58,32 @@ source_dist: paths: - dist/ +analysis: + stage: prepare + script: + - | + pip3 install radon + mkdir analysis + + - | + echo "Calculating Maintainability Index" + radon mi -s -j buildstream > analysis/mi.json + radon mi -s buildstream + + - | + echo "Calculating Cyclomatic Complexity" + radon cc -a -s -j buildstream > analysis/cc.json + radon cc -a -s buildstream + + - | + echo "Calculating Raw Metrics" + radon raw -s -j buildstream > analysis/raw.json + radon raw -s buildstream + + artifacts: + paths: + - analysis/ + ##################################################### # Test stage # ##################################################### -- cgit v1.2.1