Skip to content

Try and get coverage to upload properly #83

Try and get coverage to upload properly

Try and get coverage to upload properly #83

Workflow file for this run

name: Unit tests
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
CMAKE_VERSION: "3.27.x"
PYTHON_VERSION: "3.13"
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: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v2
- name: Configure runner (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -yq clang ninja-build xvfb
- name: Configure runner (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ env.CMAKE_VERSION }}
- 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
uses: Wandalen/wretry.action@master
with:
command: ./bin/tests
attempt_limit: 3
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: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v2
- name: Configure runner
run: |
sudo apt-get update
sudo apt-get install -yq clang llvm ninja-build xvfb
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ env.CMAKE_VERSION }}
- 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 coverage report
uses: Wandalen/wretry.action@master
with:
command: poetry run cmake --build . --config Debug -t coverage-xml
attempt_limit: 3
attempt_delay: 2000
current_path: build
- uses: codecov/codecov-action@v4
if: ${{ !env.ACT }}
with:
directory: build