Improve coverage branching calculation #60
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: Unit tests | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
main: | |
name: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
DISPLAY: ":99" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- uses: abatilo/actions-poetry@v2 | |
- name: Configure runner (Linux) | |
if: runner.os == 'Linux' | |
run: sudo apt-get install ninja-build | |
- name: Configure runner (Windows) | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: runner.os == 'Windows' | |
- name: Install Conan | |
run: | | |
poetry install | |
poetry run conan version | |
- name: Restore Conan cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.conan2 | |
key: ${{ runner.os }}-${{ hashFiles('**/conan.lock') }}-Release | |
- name: Install package dependencies | |
run: poetry run conan install . --profile:all=./.conan2/profiles/${{ runner.os }} --output-folder=build --build=missing --lockfile-partial | |
- name: Configure | |
run: cmake --preset conan-release | |
- name: Build | |
run: cmake --build --preset conan-release | |
- name: Xvfb (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
Xvfb $DISPLAY -screen 0 1920x1080x24 -ac +extension GLX & | |
sleep 5 | |
fluxbox > /dev/null 2>&1 & | |
sleep 5 | |
- name: Test | |
run: ./bin/tests | |
env: | |
ESPEAK_DATA_PATH: ./vendor/src/espeak-ng/espeak-ng-data | |
coverage: | |
runs-on: ubuntu-latest | |
needs: main | |
env: | |
DISPLAY: ":99" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- uses: abatilo/actions-poetry@v2 | |
- name: Configure runner | |
run: sudo apt-get install llvm ninja-build | |
- name: Install Conan | |
run: | | |
poetry install | |
poetry run conan version | |
- name: Restore Conan cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.conan2 | |
key: ${{ runner.os }}-${{ hashFiles('**/conan.lock') }}-Debug | |
- name: Install package dependencies | |
run: poetry run conan install . --profile:all=./.conan2/profiles/${{ runner.os }} --output-folder=build --build=missing --lockfile-partial --settings=build_type=Debug | |
- name: Configure | |
run: poetry run cmake .. -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug -DGCOVR_XML=ON | |
working-directory: build | |
- name: Xvfb | |
run: | | |
Xvfb $DISPLAY -screen 0 1920x1080x24 -ac +extension GLX & | |
sleep 5 | |
fluxbox > /dev/null 2>&1 & | |
sleep 5 | |
- name: Build XML report | |
run: poetry run cmake --build . --config Debug -t coverage-xml | |
working-directory: build | |
- uses: codecov/codecov-action@v4 | |
with: | |
directory: build |