]> granicus.if.org Git - graphviz/commitdiff
Add a metrics report with warnings to CI also for Windows
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 10 Sep 2020 17:55:46 +0000 (19:55 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 10 Sep 2020 22:56:12 +0000 (00:56 +0200)
.gitlab-ci.yml

index 15fd0b8ce12b5c0f7741a7aa1b4c428e847e7c0c..a43446f8dc95c9de79662e4af8285b1736159b2c 100644 (file)
@@ -69,6 +69,7 @@ portable-source:
     needs: []
     script:
         - $ErrorActionPreference = "Stop"
+        - $PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
         # Toolchain definitions
         - if($Env:project_platform -eq "x64") {
             $TARGET_ARCH = "x64";
@@ -82,7 +83,12 @@ portable-source:
         - $Env:graphviz_install_dir = "C:\Graphviz"
         # Build
         - Set-ExecutionPolicy Bypass -Force -Scope Process
-        - windows/bin/setup-and-build.ps1 -buildsystem $env:build_system -platform $Env:project_platform -configuration $env:configuration
+        - $logfile = New-TemporaryFile
+        - windows/bin/setup-and-build.ps1 -buildsystem $env:build_system -platform $Env:project_platform -configuration $env:configuration 2>&1 | tee $logfile
+        - $warnings_count = Invoke-Expression "grep -c ' warning ' $logfile"
+        - echo "$CI_JOB_NAME-warnings $warnings_count" > metrics.txt
+        - rm $logfile
+        - cat metrics.txt
         - python3 gen_version.py > VERSION
         - python3 gen_version.py --collection > COLLECTION
         # Package
@@ -143,6 +149,8 @@ portable-source:
         paths:
         - Packages/*/*/*/*/*/*/*.exe
         - Packages/*/*/*/*/*/*/*.zip
+        reports:
+            metrics: metrics.txt
     tags:
         - windows