mirror of https://github.com/WerWolv/ImHex.git
test: Add code coverage support with CodeCov (#1681)
This commit is contained in:
parent
f6953fd829
commit
44331506b2
|
@ -0,0 +1,3 @@
|
||||||
|
ignore:
|
||||||
|
- "lib/third_party" # Third party libraries should be ignored
|
||||||
|
- "lib/external" # Our own libraries should be checked in their own repositories
|
|
@ -34,18 +34,11 @@ jobs:
|
||||||
restore-keys: ${{ runner.os }}-tests-build
|
restore-keys: ${{ runner.os }}-tests-build
|
||||||
max-size: 50M
|
max-size: 50M
|
||||||
|
|
||||||
|
|
||||||
- name: 📜 Restore CMakeCache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
build/CMakeCache.txt
|
|
||||||
key: ${{ runner.os }}-tests-build-${{ hashFiles('**/CMakeLists.txt') }}
|
|
||||||
|
|
||||||
- name: ⬇️ Install dependencies
|
- name: ⬇️ Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo bash dist/get_deps_debian.sh
|
sudo bash dist/get_deps_debian.sh
|
||||||
|
sudo apt install gcovr -y
|
||||||
|
|
||||||
- name: 🛠️ Build
|
- name: 🛠️ Build
|
||||||
run: |
|
run: |
|
||||||
|
@ -73,6 +66,18 @@ jobs:
|
||||||
cd build
|
cd build
|
||||||
ctest --output-on-failure
|
ctest --output-on-failure
|
||||||
|
|
||||||
|
# Generate report from all gcov .gcda files
|
||||||
|
- name: 🧪 Generate coverage report
|
||||||
|
run: |
|
||||||
|
gcovr --gcov-executable /usr/bin/gcov-12 -r . build --xml coverage_report.xml --verbose
|
||||||
|
|
||||||
|
- name: Upload coverage reports to Codecov
|
||||||
|
uses: codecov/codecov-action@v4
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: true
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
file: coverage_report.xml
|
||||||
|
|
||||||
langs:
|
langs:
|
||||||
name: 🧪 Langs
|
name: 🧪 Langs
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
Loading…
Reference in New Issue