Merge branch 'code_coverage' into 'main'

Code coverage

See merge request mail/exim-encrypt-dlfunc!5
This commit is contained in:
heiko.reese
2021-09-13 00:28:12 +02:00
2 changed files with 31 additions and 4 deletions

View File

@ -11,14 +11,32 @@ stages:
.image-focal: .image-focal:
image: '${CONTAINER_REGISTRY_NAME}/exim-encrypt-dlfunc-build-focal' image: '${CONTAINER_REGISTRY_NAME}/exim-encrypt-dlfunc-build-focal'
.code-coverage:
stage: build
script:
- meson build -Db_coverage=true
- cd build
- ninja
- ninja test
- ninja coverage-xml
- grep -Eo 'line-rate="[^"]+"' meson-logs/coverage.xml | head -n 1 |
grep -Eo '[0-9.]+' | awk '{ printf "coverage\x3a %.2f%% of statements\n", $1 * 100 }'
- ninja coverage-html
- mv meson-logs/coveragereport ../coverage
artifacts:
paths:
- coverage/
reports:
cobertura: build/meson-logs/coverage.xml
.build: .build:
stage: build stage: build
script: script:
- which meson
- meson build - meson build
- cd build - cd build
- ninja - ninja
- ninja test - ninja test
- cd ..
artifacts: artifacts:
paths: paths:
- build/src/libexim-encrypt-dlfunc.so - build/src/libexim-encrypt-dlfunc.so
@ -39,10 +57,17 @@ stages:
- ./*.changes - ./*.changes
- ./*.buildinfo - ./*.buildinfo
code-coverage:
extends:
- .image-bullseye
- .code-coverage
needs: [ ]
build:bullseye: build:bullseye:
extends: extends:
- .image-bullseye - .image-bullseye
- .build - .build
- .code-coverage
needs: [ ] needs: [ ]
build:focal: build:focal:

View File

@ -52,13 +52,15 @@ for i in "${images[@]}"; do
buildah run "$ctr" /bin/sh -c 'apt-get update; \ buildah run "$ctr" /bin/sh -c 'apt-get update; \
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y \ DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y \
build-essential \ build-essential \
git \ exim4-daemon-heavy \
exim4-dev \ exim4-dev \
gcovr \
git \
libsodium-dev \ libsodium-dev \
openssl \
pkg-config \ pkg-config \
python3-pip \ python3-pip \
exim4-daemon-heavy \ libxml2-utils; \
openssl; \
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y \ DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y \
debhelper \ debhelper \
debsigs \ debsigs \