From 13ed114d1487d33fce28809d15754e3a4bd07dcf Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 20 Jan 2025 12:09:40 -0500 Subject: [PATCH 1/6] separate coverage combine into separate step --- .github/workflows/test.yml | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9705d5e87..65a6e673ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -235,8 +235,7 @@ jobs: run: exit 1 consolidate-coverage: - # Consolidate code coverage using `coverage combine` and upload - # to the codecov app + # Consolidate code coverage using `coverage combine` runs-on: ubuntu-latest needs: [tests, fuzzing] @@ -261,10 +260,40 @@ jobs: - name: Combine coverage run: | coverage combine coverage-files/**/.coverage + # coverage report and fail if coverage is too low + coverage report --fail-under=90 coverage xml + - name: Upload coverage artifact + # upload coverage sqlite db for debugging + uses: actions/upload-artifact@v4 + with: + name: coverage-sqlite + include-hidden-files: true + path: .coverage + if-no-files-found: error + + - name: Upload coverage artifact + uses: actions/upload-artifact@v4 + with: + name: coverage-xml + path: coverage.xml + if-no-files-found: error + + upload-coverage: + # upload coverage to the codecov app + runs-on: ubuntu-latest + needs: [tests, fuzzing] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: coverage-xml + - name: Upload Coverage uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - file: coverage.xml + file: coverage-xml/coverage.xml From 753782b55ec1c204ae3108c017ca4928a0c17225 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 20 Jan 2025 12:29:18 -0500 Subject: [PATCH 2/6] fixes --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65a6e673ad..03cb58fda9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -264,7 +264,7 @@ jobs: coverage report --fail-under=90 coverage xml - - name: Upload coverage artifact + - name: Upload coverage sqlite artifact # upload coverage sqlite db for debugging uses: actions/upload-artifact@v4 with: @@ -273,7 +273,7 @@ jobs: path: .coverage if-no-files-found: error - - name: Upload coverage artifact + - name: Upload coverage.xml uses: actions/upload-artifact@v4 with: name: coverage-xml @@ -283,7 +283,7 @@ jobs: upload-coverage: # upload coverage to the codecov app runs-on: ubuntu-latest - needs: [tests, fuzzing] + needs: [consolidate-coverage] steps: - uses: actions/checkout@v4 @@ -296,4 +296,4 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - file: coverage-xml/coverage.xml + file: coverage.xml From ce280ef8c64dec616641cbb9766d59297f6e76be Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 20 Jan 2025 12:32:12 -0500 Subject: [PATCH 3/6] separate coverage steps --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03cb58fda9..c42c5883a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -260,8 +260,14 @@ jobs: - name: Combine coverage run: | coverage combine coverage-files/**/.coverage + + - name: Coverage report + run: | # coverage report and fail if coverage is too low coverage report --fail-under=90 + + - name: Generate coverage.xml + run: | coverage xml - name: Upload coverage sqlite artifact From 44e277ba9f9d3fc91b8d583e1fb964558fa294a8 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 20 Jan 2025 12:53:06 -0500 Subject: [PATCH 4/6] move a comment --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c42c5883a8..20451f1aed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -262,8 +262,8 @@ jobs: coverage combine coverage-files/**/.coverage - name: Coverage report + # coverage report and fail if coverage is too low run: | - # coverage report and fail if coverage is too low coverage report --fail-under=90 - name: Generate coverage.xml @@ -293,7 +293,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 with: name: coverage-xml From 16287463b5b16e9c100ea0b618cf6843239f6a17 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 20 Jan 2025 12:55:04 -0500 Subject: [PATCH 5/6] update job name --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20451f1aed..d6c0b744de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -234,8 +234,9 @@ jobs: if: ${{ needs.fuzzing.result != 'success' }} run: exit 1 - consolidate-coverage: - # Consolidate code coverage using `coverage combine` + coverage-report: + # Consolidate code coverage using `coverage combine` and + # call coverage report with fail-under=90 runs-on: ubuntu-latest needs: [tests, fuzzing] From d853ec014d90386d24a4d742694c18d6c7798d7f Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 20 Jan 2025 13:34:12 -0500 Subject: [PATCH 6/6] fix job name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6c0b744de..d4bfc2ee9c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -290,7 +290,7 @@ jobs: upload-coverage: # upload coverage to the codecov app runs-on: ubuntu-latest - needs: [consolidate-coverage] + needs: [coverage-report] steps: - uses: actions/checkout@v4