Skip to content

Commit

Permalink
Fix codecov reports (#1524)
Browse files Browse the repository at this point in the history
* 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 <phy.tiger@gmail.com>
  • Loading branch information
egecetin and tigercosmos authored Aug 12, 2024
1 parent 650e6da commit 8344607
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
59 changes: 31 additions & 28 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ coverage:
codecov:
notify:
after_n_builds: 16
wait_for_ci: yes

ignore:
- "3rdParty/*"
- "Tests/*"
- "Examples/*"

0 comments on commit 8344607

Please sign in to comment.