mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 01:56:21 +00:00
feat: add code coverage support
- Add --enable-coverage option to configure.ac - Add coverage and coverage-html targets to Makefile.am - Add coverage CI job with Codecov upload - Add lcov to all Dockerfiles (arch, debian, fedora, tumbleweed, ubuntu) Usage: ./configure --enable-coverage make check make coverage-html
This commit is contained in:
24
.github/workflows/ci-code.yml
vendored
24
.github/workflows/ci-code.yml
vendored
@@ -98,3 +98,27 @@ jobs:
|
||||
- name: Check spelling
|
||||
run: |
|
||||
codespell
|
||||
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
name: Code Coverage
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build and run coverage
|
||||
run: |
|
||||
docker build -f Dockerfile.debian -t profanity-cov .
|
||||
docker run -v ${{ github.workspace }}/coverage:/coverage profanity-cov bash -c '
|
||||
./bootstrap.sh
|
||||
./configure --enable-coverage --enable-otr --enable-pgp --enable-omemo --enable-plugins
|
||||
make -j$(nproc)
|
||||
make check || true
|
||||
lcov --capture --directory . --output-file /coverage/coverage.info --ignore-errors inconsistent
|
||||
lcov --remove /coverage/coverage.info "/usr/*" "*/tests/*" --output-file /coverage/coverage.info --ignore-errors inconsistent
|
||||
'
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ./coverage/coverage.info
|
||||
fail_ci_if_error: false
|
||||
verbose: true
|
||||
Reference in New Issue
Block a user