From 83446075c03554434178c85a25e10720043942a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20=C3=87etin?= <64282645+egecetin@users.noreply.github.com> Date: Mon, 12 Aug 2024 07:39:18 +0300 Subject: [PATCH] Fix codecov reports (#1524) * Fix codecov reports * remove all gcno files to prevent caching * remove after restore * dir fixed? * maybe after configure * ccache configuration to fix * try to exclude gcda gcno * Bump action version * remove unneccesary flag --------- Co-authored-by: Liu, An-Chi --- .github/workflows/build_and_test.yml | 59 +++++++++++++++------------- codecov.yml | 6 +++ 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 1c501e9697..1a08fc9bce 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -95,7 +95,10 @@ jobs: id: ccache-restore uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: - path: ${{ env.CCACHE_DIR }} + path: | + ${{ env.CCACHE_DIR }} + !*.gcda + !*.gcno key: ${{ matrix.image }}-ccache-${{ github.run_id }} restore-keys: | ${{ matrix.image }}-ccache @@ -133,20 +136,20 @@ jobs: - name: Test Tutorials run: cd build_examples/tutorials_bin && ./Tutorial-HelloWorld - # - name: Create Cobertura Report - # run: | - # ${{ matrix.python }} -m pip install gcovr - # gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml - - # - name: Upload Coverage Results - # uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 - # with: - # files: ./coverage.xml - # flags: ${{ matrix.image }},unittest - # fail_ci_if_error: false - # verbose: true - # env: - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Create Cobertura Report + run: | + ${{ matrix.python }} -m pip install gcovr + gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml + + - name: Upload Coverage Results + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 + with: + files: ./coverage.xml + flags: ${{ matrix.image }},unittest + fail_ci_if_error: false + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Save Ccache uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -378,16 +381,16 @@ jobs: python3 -m pip install gcovr gcovr -v -r . $GCOVR_FLAGS -o coverage.xml - # - name: Upload Coverage Results - # uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 - # if: ${{ matrix.host-arch == matrix.arch }} - # with: - # files: ./coverage.xml - # flags: ${{ matrix.os-version }},unittest - # fail_ci_if_error: false - # verbose: true - # env: - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload Coverage Results + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 + if: ${{ matrix.host-arch == matrix.arch }} + with: + files: ./coverage.xml + flags: ${{ matrix.os-version }},unittest + fail_ci_if_error: false + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Save Ccache uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -468,7 +471,7 @@ jobs: run: gcovr -v -g -k -r . $env:GCOVR_FLAGS.split() -o coverage.xml - name: Upload Coverage Results - uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: files: ./coverage.xml flags: ${{ matrix.sys }},unittest @@ -559,7 +562,7 @@ jobs: python -m pytest --root-path=../../Dist/examples_bin - name: Upload Coverage Results - uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: files: ./Tests/Pcap++Test/Pcap++Coverage.xml,./Tests/Packet++Test/Packet++Coverage.xml flags: ${{ matrix.os }},unittest,${{ matrix.pcap_lib }} @@ -718,7 +721,7 @@ jobs: gcovr -v -r . $GCOVR_FLAGS -o coverage.xml - name: Upload Coverage Results - uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: files: ./coverage.xml flags: xdp,unittest diff --git a/codecov.yml b/codecov.yml index 5b852de37f..846afb7749 100644 --- a/codecov.yml +++ b/codecov.yml @@ -8,3 +8,9 @@ coverage: codecov: notify: after_n_builds: 16 + wait_for_ci: yes + +ignore: + - "3rdParty/*" + - "Tests/*" + - "Examples/*"