ci: integrate coverage into linux arch job, remove duplicate
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 29s
CI Code / Linux (debian) (pull_request) Successful in 6m45s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m48s
CI Code / Linux (arch) (pull_request) Successful in 7m18s

- Linux arch job now uploads coverage.info as artifact
- ci-build.sh saves coverage.info before cleanup
- Removed separate coverage job (was duplicating arch build)
- Saves ~25% CI time by eliminating redundant build
This commit is contained in:
2026-01-29 15:53:03 +03:00
parent 6c5c523a1a
commit 7795877306
2 changed files with 21 additions and 27 deletions

View File

@@ -32,7 +32,19 @@ jobs:
- name: Run tests
run: |
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
docker run profanity ./ci-build.sh
docker run -v ${{ github.workspace }}:/workspace profanity bash -c '
./ci-build.sh
if [ -f coverage.info ]; then
cp coverage.info /workspace/
fi
'
- name: Upload coverage artifact
if: matrix.flavor == 'arch'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.info
retention-days: 30
code-style:
runs-on: ubuntu-latest
@@ -97,29 +109,4 @@ jobs:
sudo apt install -y --no-install-recommends codespell
- name: Check spelling
run: |
codespell
coverage:
runs-on: ubuntu-latest
name: Code Coverage
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
make check-functional-parallel || true
lcov --capture --directory . --output-file /coverage/coverage.info \
--rc branch_coverage=1 \
--ignore-errors inconsistent
lcov --remove /coverage/coverage.info \
"/usr/include/*" "*/tests/*" \
--output-file /coverage/coverage.info \
--rc branch_coverage=1 \
--ignore-errors inconsistent,empty,unused
lcov --summary /coverage/coverage.info
'
codespell

View File

@@ -286,6 +286,13 @@ build_and_test() {
fi
./profanity -v
# Save coverage.info before cleanup (for CI artifact)
if [ "$run_coverage" = "yes" ] && [ -f coverage.info ]; then
cp coverage.info ../coverage.info
echo "Coverage report saved to coverage.info"
fi
$MAKE clean
cd ..