exclude generated files from coverage report #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build-and-test: | |
name: test on ${{ matrix.os }} with ${{ matrix.cxx }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
cxx: g++ | |
coverage: "true" | |
- os: ubuntu-22.04 | |
cxx: clang++ | |
coverage: "false" | |
- os: macos-latest | |
cxx: clang++ | |
coverage: "false" | |
# Do not auto-cancel other runners if one fails | |
fail-fast: false | |
env: | |
CXX: ${{ matrix.cxx }} | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: dependencies (libraries) | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: sudo apt-get install zlib1g-dev libisal-dev libdeflate-dev gcovr | |
- name: dependencies (libraries) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: brew install isa-l libdeflate | |
- name: dependencies (pip) | |
run: python3 -m pip install meson ninja jsonschema sphinx | |
- name: setup | |
run: meson setup builddir -Db_sanitize=address,undefined -Db_coverage=${{ matrix.coverage }} | |
- name: install | |
run: DESTDIR=${PWD}/install meson install -C builddir | |
- name: examples | |
run: make -C examples EXE=${PWD}/builddir/src/adapterremoval3 | |
- name: regression tests | |
run: meson test -C builddir --suite regression --print-errorlogs | |
# Unit tests are run last to enable cleanup of coverage data from other | |
# actions before running coveralls | |
- name: unit tests | |
run: | | |
find . -name '*.gcda' -print -delete | |
meson test -C builddir --suite unit --print-errorlogs | |
- name: coveralls | |
if: ${{ matrix.coverage == 'true' }} | |
run: | | |
python3 -m pip install cpp-coveralls | |
coveralls | |
--exclude tests | |
--exclude-pattern 'reports_template_html\..*' | |
--build-root "${PWD}" \ | |
--gcov-options '\-lpbc' |