chore: include test binaries in coverage analysis

This commit is contained in:
Marcus Holland-Moritz 2024-01-01 23:54:39 +01:00
parent 310c8b6fad
commit 3eb6b22090
2 changed files with 9 additions and 2 deletions

View File

@ -105,7 +105,7 @@ if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then
rm -rf /tmp-runner/coverage rm -rf /tmp-runner/coverage
mkdir -p /tmp-runner/coverage mkdir -p /tmp-runner/coverage
llvm-profdata-17 merge -sparse profile/* -o dwarfs.profdata llvm-profdata-17 merge -sparse profile/* -o dwarfs.profdata
for binary in mkdwarfs dwarfs dwarfsck dwarfsextract; do for binary in mkdwarfs dwarfs dwarfsck dwarfsextract *_test; do
llvm-cov-17 show -instr-profile=dwarfs.profdata $binary >/tmp-runner/coverage/$binary.txt llvm-cov-17 show -instr-profile=dwarfs.profdata $binary >/tmp-runner/coverage/$binary.txt
done done
fi fi

View File

@ -132,10 +132,17 @@ jobs:
--env GITHUB_RUN_ATTEMPT \ --env GITHUB_RUN_ATTEMPT \
dwarfs-linux-build dwarfs-linux-build
- name: List Coverage Files
id: coverage-files
if: matrix.build_type == 'clang-coverage-ninja'
run: |
files=$(find ${{ runner.temp }}/coverage -type f | paste -d, -s)
echo "list=$files" >> "$GITHUB_OUTPUT"
- name: Upload Coverage Data - name: Upload Coverage Data
if: matrix.build_type == 'clang-coverage-ninja' if: matrix.build_type == 'clang-coverage-ninja'
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ runner.temp }}/coverage files: ${{ steps.coverage-files.outputs.list }}
fail_ci_if_error: true fail_ci_if_error: true