2020-03-13 22:42:15 +01:00
|
|
|
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
|
|
|
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
|
|
|
name: Coverage
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2020-12-15 10:59:09 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-03-13 22:42:15 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
run: |
|
2020-04-07 20:23:54 +02:00
|
|
|
sudo apt-get update
|
2020-03-13 22:42:15 +01:00
|
|
|
sudo apt-get install libxml2-utils
|
2020-12-15 10:59:09 +01:00
|
|
|
sudo apt-get install libz3-dev libz3-4
|
2020-03-13 22:42:15 +01:00
|
|
|
sudo apt-get install lcov
|
2021-01-20 21:10:24 +01:00
|
|
|
sudo apt-get install libcppunit-dev
|
2020-03-13 22:42:15 +01:00
|
|
|
pip install lcov_cobertura
|
|
|
|
|
|
|
|
- name: Compile instrumented
|
|
|
|
run: |
|
2020-04-19 11:04:02 +02:00
|
|
|
make test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" USE_Z3=yes HAVE_RULES=yes -j$(nproc)
|
2020-03-13 22:42:15 +01:00
|
|
|
|
|
|
|
- name: Generate coverage report
|
|
|
|
run: |
|
|
|
|
rm -rf coverage_report
|
|
|
|
./testrunner
|
|
|
|
test/cfg/runtests.sh
|
|
|
|
gcov lib/*.cpp -o lib/
|
|
|
|
lcov --directory ./ --capture --output-file lcov_tmp.info -b ./
|
|
|
|
lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info
|
|
|
|
genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp
|
|
|
|
|
2020-12-15 10:59:09 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
2020-03-13 22:42:15 +01:00
|
|
|
with:
|
|
|
|
name: Coverage results
|
|
|
|
path: coverage_report
|
|
|
|
|
|
|
|
- uses: codecov/codecov-action@v1
|
|
|
|
with:
|
2020-04-19 11:04:02 +02:00
|
|
|
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
2020-03-13 22:42:15 +01:00
|
|
|
# file: ./coverage.xml # optional
|
|
|
|
flags: unittests # optional
|
|
|
|
name: ${{ github.repository }} # optional
|
|
|
|
fail_ci_if_error: true # optional (default = false):
|