summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-16 22:27:32 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-16 22:30:54 +0900
commiteb0ad4d432ac4ab2680f1f677d28ebc3ed73f63c (patch)
tree36919b9b434f57d6d89225eeb0b52c509232ed9c
parent827a12947bd8323fdfb7ec16233db963df965526 (diff)
downloadbuildstream-tristan/radon.tar.gz
.gitlab-ci.yml: Perform some python code analysis with radontristan/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.
-rw-r--r--.gitlab-ci.yml26
1 files changed, 26 insertions, 0 deletions
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 #
#####################################################