From 941a2903904ce4f434360206a4dfb9f74dc6908f Mon Sep 17 00:00:00 2001 From: esrrhs Date: Fri, 18 Sep 2026 17:36:27 +0800 Subject: [PATCH 1/2] fix: restore Codecov per-file line coverage uploads The bash uploader ran with an empty CODECOV secret so -f was parsed as the token, Codecov returned 404, and CI swallowed it. Upload via codecov-action from the repo root and only ship src/include lcov data. Co-authored-by: Cursor --- .github/workflows/build.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06ad616..7f841bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ on: permissions: contents: read + id-token: write jobs: build: @@ -191,11 +192,29 @@ jobs: - name: Coverage report if: matrix.build_type == 'cov' run: | - set -x + set -eux cd build echo "function main() return 0 end" > test.lua ./bin/flua --repeat=2 test.lua - lcov --directory ./ --capture --output-file coverage.info --ignore-errors source --ignore-errors mismatch + cd "$GITHUB_WORKSPACE" + # Only this repo's sources. Uploading Boost/CPM/usr headers makes Codecov + # drop file-level reports because paths cannot be matched to GitHub. + lcov --directory build --capture --output-file coverage.info \ + --base-directory "$GITHUB_WORKSPACE" --no-external \ + --ignore-errors source,mismatch + lcov --extract coverage.info \ + "$GITHUB_WORKSPACE/src/*" \ + "$GITHUB_WORKSPACE/include/*" \ + --output-file coverage.info ls -l coverage.info lcov --list coverage.info - bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV }} -f coverage.info || echo "Codecov did not collect coverage reports" + + - name: Upload coverage to Codecov + if: matrix.build_type == 'cov' + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV }} + files: coverage.info + disable_search: true + fail_ci_if_error: true + verbose: true From 78e44e6fd0938003809a78c0a70cb0c5f5710437 Mon Sep 17 00:00:00 2001 From: esrrhs Date: Fri, 18 Sep 2026 17:39:06 +0800 Subject: [PATCH 2/2] ci: upload coverage with CODECOV_TOKEN Co-authored-by: Cursor --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f841bc..f999146 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -213,7 +213,7 @@ jobs: if: matrix.build_type == 'cov' uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV }} + token: ${{ secrets.CODECOV_TOKEN }} files: coverage.info disable_search: true fail_ci_if_error: true