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
This commit is contained in:
Oliver Stöneberg 2022-09-04 10:25:59 +02:00 committed by GitHub
parent 4d767d821e
commit 0f5d2a31b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -23,22 +23,25 @@ jobs:
- name: Install missing software on ubuntu - name: Install missing software on ubuntu
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install libxml2-utils sudo apt-get install libxml2-utils lcov
sudo apt-get install lcov
sudo apt-get install libcppunit-dev - name: Install missing Python packages on ubuntu
run: |
python -m pip install pip --upgrade python -m pip install pip --upgrade
python -m pip install lcov_cobertura python -m pip install lcov_cobertura
- name: Compile instrumented - name: Compile instrumented
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes make -j$(nproc) all CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes
- name: Run instrumented tests
run: |
./testrunner
test/cfg/runtests.sh
- name: Generate coverage report - name: Generate coverage report
run: | run: |
rm -rf coverage_report
./testrunner
test/cfg/runtests.sh
gcov lib/*.cpp -o lib/ gcov lib/*.cpp -o lib/
lcov --directory ./ --capture --output-file lcov_tmp.info -b ./ lcov --directory ./ --capture --output-file lcov_tmp.info -b ./
lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info