From 5bd1367cad59edea96ebfb67486e4b8cf2aad2a3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 15:49:16 -0800 Subject: [PATCH 1/8] Fix codecov upload condition in CI workflow The upload condition used 'discard' which never matches any matrix value, preventing coverage data from being uploaded. Changed to 'ubuntu' to match the actual os-type matrix value. --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index d2218de6..31c3f81e 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -669,4 +669,4 @@ jobs: run: | cd build ; bash <(curl -s https://codecov.io/bash) ; - if: ${{ matrix.os-type == 'discard' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} + if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} From fcdede1ba599cc72ec690aa28dd487e30af975dd Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 16:10:03 -0800 Subject: [PATCH 2/8] Replace deprecated Codecov bash uploader with official GitHub Action The bash uploader now requires a token and is deprecated. Using codecov/codecov-action@v5 which handles authentication automatically for public repos via GitHub OIDC. --- .github/workflows/verify-build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 31c3f81e..271fe94d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -665,8 +665,9 @@ jobs: sleep 5 && ab -n 1000000 -c 100 127.0.0.1:8080/plaintext if: ${{ matrix.build-type == 'threads' }} - - name: Push code coverage data - run: | - cd build ; - bash <(curl -s https://codecov.io/bash) ; + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + directory: build + fail_ci_if_error: false if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} From e2dbaf78ee904fd74664c0991ec7fb38ca68c993 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 20:14:57 -0800 Subject: [PATCH 3/8] Add gcovr step to generate coverage report before Codecov upload The codecov-action@v5 does not auto-process gcov data like the old bash uploader did. This adds a step to run gcovr to convert .gcda/.gcno files to Cobertura XML format, which codecov can parse. --- .github/workflows/verify-build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 271fe94d..0aff0484 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -665,9 +665,15 @@ jobs: sleep 5 && ab -n 1000000 -c 100 127.0.0.1:8080/plaintext if: ${{ matrix.build-type == 'threads' }} + - name: Generate coverage report + run: | + cd build + gcovr --xml coverage.xml --xml-pretty + if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} + - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: - directory: build + files: build/coverage.xml fail_ci_if_error: false if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} From fd6cd28e0d536068d1111d976c6a2e952548faa1 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 20:35:28 -0800 Subject: [PATCH 4/8] Add CODECOV_TOKEN for protected branch uploads Codecov requires authentication token for uploading coverage reports to protected branches. --- .github/workflows/verify-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 0aff0484..294e3539 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -674,6 +674,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: + token: ${{ secrets.CODECOV_TOKEN }} files: build/coverage.xml fail_ci_if_error: false if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} From b0b0a05fbe2e66b12fc1aebb69bbdf02d4a4a8c3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 20:39:05 -0800 Subject: [PATCH 5/8] Trigger CI to test Codecov upload with token From 9b3305e3b41383559c03bbea95a4ba361c51f895 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 21:35:38 -0800 Subject: [PATCH 6/8] Add --root option to gcovr for correct source path mapping The coverage report was unusable because gcovr generated paths relative to the build directory (e.g., ../src/webserver.cpp). Adding --root .. ensures paths are relative to the repository root, allowing Codecov to correctly match source files. --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 294e3539..2ff874b8 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -668,7 +668,7 @@ jobs: - name: Generate coverage report run: | cd build - gcovr --xml coverage.xml --xml-pretty + gcovr --root .. --xml coverage.xml --xml-pretty if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} - name: Upload coverage to Codecov From 1e2b2aacd023d8110b3036872b9e163462ff8446 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 21:44:23 -0800 Subject: [PATCH 7/8] Exclude test directory from coverage reports --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 2ff874b8..6f632dec 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -668,7 +668,7 @@ jobs: - name: Generate coverage report run: | cd build - gcovr --root .. --xml coverage.xml --xml-pretty + gcovr --root .. --exclude test/ --xml coverage.xml --xml-pretty if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} - name: Upload coverage to Codecov From 4cfe7acf88ba951a7128f8fd57453eac82cacdb7 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 30 Jan 2026 21:50:12 -0800 Subject: [PATCH 8/8] Ignore tests --- codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codecov.yml b/codecov.yml index a6e1de74..97a08e6a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -18,3 +18,6 @@ comment: layout: "reach,diff,flags,files,footer" behavior: default require_changes: no + +ignore: + - "test"