From 2c308e824e2b7aa2b5174cbb1d5530f6b6a109bb Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Thu, 29 Jan 2026 15:53:03 +0300 Subject: [PATCH] ci: integrate coverage into linux arch job, remove duplicate - 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 --- .github/workflows/ci-code.yml | 41 ++++++++++++----------------------- ci-build.sh | 7 ++++++ 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml index b3e3abb5..81116a77 100644 --- a/.github/workflows/ci-code.yml +++ b/.github/workflows/ci-code.yml @@ -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 - ' \ No newline at end of file + codespell \ No newline at end of file diff --git a/ci-build.sh b/ci-build.sh index a971b3cd..7180d47c 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -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 ..