[at-spi2-core: 5/7] Hack to make the shell pipeline work for grepping coverage.xml




commit 0e64df72bd94766dd0df9505e0a8782f324f0d63
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jun 6 10:57:38 2022 -0500

    Hack to make the shell pipeline work for grepping coverage.xml
    
    The first call to grep actually finds what it is supposed to
    find (lines with 'line-rate' and numbers), but it exits with a nonzero
    exit code.  The rest of the pipeline is fine.
    
    I have no idea why that first grep is doing that.  So, hack around
    it.  The end result is the correct one, anyway.

 .gitlab-ci.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 38f39765..72ea65ad 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -152,7 +152,9 @@ coverage:
     - grcov _build --source-dir ./ --prefix-dir ../ --output-type html --branch --ignore-not-existing -o 
_coverage
     - mkdir -p public/
     - cp -r _coverage public/coverage
-    - grep -Eo 'line-rate="[^"]+"' coverage.xml | head -n 1 | grep -Eo '[0-9.]+' | awk '{ print "Coverage:", 
$1 * 100 }'
+    # In the following line, the first grep finds what it is supposed to find, but exits with a nonzero code.
+    # I have no idea why.  So, force the whole pipeline to return true.
+    - (grep -Eo 'line-rate="[^"]+"' coverage.xml | head -n 1 | grep -Eo '[0-9.]+' | awk '{ print 
"Coverage:", $1 * 100 }') || true
   coverage: '/Coverage: \d+\.\d+/'
   artifacts:
     name: "at-spi2-core-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
@@ -163,6 +165,7 @@ coverage:
     paths:
       - "_build/meson-logs"
       - public
+      - coverage.xml
 
 reference:
   stage: docs


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]