mirror of https://github.com/nirenjan/libx52.git
build: Add coverage support with codecov.io
This change adds code coverage to the Meson builds, and reports them to codecov.io, to help keep the code coverage high.pull/64/head
parent
45d561e0d8
commit
08a6b0a736
|
|
@ -0,0 +1,44 @@
|
||||||
|
name: Code Coverage
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
- '!gh-pages'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
coverage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
./.github/scripts/install-dependencies-ubuntu.sh
|
||||||
|
sudo apt-get install -y gcovr
|
||||||
|
|
||||||
|
- name: Configure and Build
|
||||||
|
run: |
|
||||||
|
meson setup build -Db_coverage=true --buildtype=debug
|
||||||
|
meson compile -C build
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: meson test -C build
|
||||||
|
|
||||||
|
- name: Generate Coverage Report
|
||||||
|
run: |
|
||||||
|
# This generates the XML report for the upload step
|
||||||
|
ninja -C build coverage-xml
|
||||||
|
|
||||||
|
- name: Upload Report to Codecov
|
||||||
|
uses: codecov/codecov-action@v5
|
||||||
|
with:
|
||||||
|
files: buildd/meson-logs/coverage.xml
|
||||||
|
fail_ci_if_error: true
|
||||||
Loading…
Reference in New Issue