Skip to content

Commit

Permalink
Try and generate coverage report in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
H0R5E committed Nov 15, 2024
1 parent 9d2fd59 commit 3f94702
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ hashFiles('**/conan.lock') }}
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
Expand All @@ -51,3 +51,39 @@ jobs:
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 clang 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: cmake .. -G Ninja -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: cmake --build . --config Debug -t coverage-xml
working-directory: build

0 comments on commit 3f94702

Please sign in to comment.