CI: add coverage parsing to the job
It works only if enabled via CI/CD Settings. More info available at https://docs.gitlab.com/ee/user/project/pipelines/settings.html#test-coverage-parsing. The parsing regex was tested on my GitLab forked project.
This commit is contained in:
parent
316b901296
commit
8fb43047df
1 changed files with 7 additions and 0 deletions
|
@ -83,6 +83,8 @@ test:
|
||||||
coverage:
|
coverage:
|
||||||
<<: *save_build_logs
|
<<: *save_build_logs
|
||||||
stage: test
|
stage: test
|
||||||
|
variables:
|
||||||
|
coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- *environment_information
|
- *environment_information
|
||||||
|
@ -96,6 +98,11 @@ coverage:
|
||||||
- ninja -C _build test
|
- ninja -C _build test
|
||||||
- ninja -C _build coverage-html
|
- ninja -C _build coverage-html
|
||||||
|
|
||||||
|
# Parse the report to get the coverage result
|
||||||
|
- |
|
||||||
|
echo == Coverage ==
|
||||||
|
sed -e 's/<[^>]*>//g' _build/meson-logs/coveragereport/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n' ' '; echo
|
||||||
|
|
||||||
##
|
##
|
||||||
# Stage: Delivery
|
# Stage: Delivery
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue