ci: integrate coverage into linux arch job, remove duplicate
All checks were successful
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m58s
CI Code / Linux (debian) (pull_request) Successful in 7m3s
CI Code / Linux (arch) (pull_request) Successful in 7m6s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m58s
CI Code / Linux (debian) (pull_request) Successful in 7m3s
CI Code / Linux (arch) (pull_request) Successful in 7m6s
- 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:
41
.github/workflows/ci-code.yml
vendored
41
.github/workflows/ci-code.yml
vendored
@@ -32,7 +32,19 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
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:
|
code-style:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -97,29 +109,4 @@ jobs:
|
|||||||
sudo apt install -y --no-install-recommends codespell
|
sudo apt install -y --no-install-recommends codespell
|
||||||
- name: Check spelling
|
- name: Check spelling
|
||||||
run: |
|
run: |
|
||||||
codespell
|
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
|
|
||||||
'
|
|
||||||
@@ -286,6 +286,13 @@ build_and_test() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
./profanity -v
|
./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
|
$MAKE clean
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
Reference in New Issue
Block a user