From 0f5d2a31b337731afc5e9443b506a8f912cecf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sun, 4 Sep 2022 10:25:59 +0200 Subject: [PATCH] coverage.yml: avoid unnecessary test execution and package installation / come cleanups (#4434) * coverage.yml: avoid duplicated test execution * coverage.yml: split test execution and report generation into separate steps * coverage.yml: split software and Python package installation into separate steps * coverage.yml: removed unnecessary `libcppunit-dev` installation - library headers are only needed when performing syntax checking --- .github/workflows/coverage.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2d8b606b0..141ce60a7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,22 +23,25 @@ jobs: - name: Install missing software on ubuntu run: | sudo apt-get update - sudo apt-get install libxml2-utils - sudo apt-get install lcov - sudo apt-get install libcppunit-dev + sudo apt-get install libxml2-utils lcov + + - name: Install missing Python packages on ubuntu + run: | python -m pip install pip --upgrade python -m pip install lcov_cobertura - name: Compile instrumented run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes - - - name: Generate coverage report + make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes + + - name: Run instrumented tests run: | - rm -rf coverage_report ./testrunner test/cfg/runtests.sh + + - name: Generate coverage report + run: | gcov lib/*.cpp -o lib/ lcov --directory ./ --capture --output-file lcov_tmp.info -b ./ lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info