]> granicus.if.org Git - graphviz/commitdiff
Add a metrics report with warnings to CI
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 28 Aug 2020 12:51:45 +0000 (14:51 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 29 Aug 2020 08:32:08 +0000 (10:32 +0200)
.gitlab-ci.yml

index 4172e3575996717b7ce1b627e9b657858a6dd540..15fd0b8ce12b5c0f7741a7aa1b4c428e847e7c0c 100644 (file)
@@ -27,7 +27,11 @@ portable-source:
 .build_template: &rpm_build_definition
     stage: build
     script:
-        - ci/build.sh
+        - logfile=`mktemp`
+        - ci/build.sh |& tee $logfile
+        - echo "$CI_JOB_NAME-warnings `grep -c 'warning:' $logfile`" > metrics.txt
+        - rm $logfile
+        - cat metrics.txt
     artifacts:
         when: on_success
         expire_in: 1 week
@@ -35,13 +39,19 @@ portable-source:
             - Packages/*/*/*/*/*/*.rpm
             - Packages/*/*/*/*/*.rpm
             - Metadata/*/*/*/configure.log
+        reports:
+            metrics: metrics.txt
     except:
         - tags
 
 .build_template: &deb_build_definition
     stage: build
     script:
-        - ci/build.sh
+        - logfile=`mktemp`
+        - ci/build.sh |& tee $logfile
+        - echo "$CI_JOB_NAME-warnings `grep -c 'warning:' $logfile`" > metrics.txt
+        - rm $logfile
+        - cat metrics.txt
     artifacts:
         when: on_success
         expire_in: 1 week
@@ -49,6 +59,8 @@ portable-source:
             - Packages/*/*/*/*/*/*deb
             - Packages/*/*/*/*/*.gz
             - Metadata/*/*/*/configure.log
+        reports:
+            metrics: metrics.txt
     except:
         - tags