trigger-tests #21
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: Tests | |
on: | |
repository_dispatch: | |
types: [trigger-tests] | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
container: | |
image: tobitflatscher/lbt | |
volumes: | |
- ${{ github.workspace }}:/code/lbt | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install gcovr | |
run: | | |
apt-get update | |
apt-get install -y gcovr | |
- name: Create build folder | |
run: mkdir build | |
- name: Run CMake | |
run: cmake -B /code/lbt/build -S /code/lbt -D BUILD_TESTING=on -D ENABLE_COVERAGE=on | |
- name: Compile with Make | |
run: make -j $(nproc) -C /code/lbt/build | |
- name: Run unit tests | |
run: (cd /code/lbt/build/ && ctest -j $(nproc)) | |
- name: Generate code coverage report | |
run: gcovr -j $(nproc) --filter /code/lbt/include --filter /code/lbt/src --print-summary --xml-pretty --xml /code/lbt/coverage.xml | |
- name: Update Codecov code coverage report | |
uses: codecov/codecov-action@v3 | |
with: | |
files: /code/lbt/coverage.xml |