From 36fc7cbeb89fea437e05d8fbcba63735abad4f52 Mon Sep 17 00:00:00 2001 From: lezi-fun <177434121+lezi-fun@users.noreply.github.com> Date: Thu, 13 Aug 2026 14:27:36 +0800 Subject: [PATCH] ci: generate Codecov coverage from Node tests --- .github/workflows/coverage.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3ae1d97..3c9e2d9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -64,9 +64,6 @@ jobs: - name: Run integration tests with coverage run: | - mkdir -p .coverage-tmp - NODE_OPTIONS=--enable-source-maps \ - NODE_V8_COVERAGE="$PWD/.coverage-tmp" \ node node_modules/next/dist/bin/next start -H 127.0.0.1 -p "$PORT" > server.log 2>&1 & server_pid=$! cleanup() { @@ -96,16 +93,13 @@ jobs: cleanup trap - EXIT - npx c8 report \ - --all \ - --include 'app/**/*.js' \ - --include 'lib/**/*.js' \ - --exclude-after-remap \ - --reporter text \ - --reporter html \ - --reporter lcov \ - --reports-dir coverage \ - --temp-directory .coverage-tmp + mkdir -p coverage + node --test \ + --experimental-test-coverage \ + --test-reporter=lcov \ + --test-reporter-destination=coverage/lcov.info \ + test/http-cache.test.js \ + test/i18n-ui.test.js test -s coverage/lcov.info covered_lines=$(awk -F: '/^DA:/{split($2, data, ","); hits += data[2]} END {print hits + 0}' coverage/lcov.info) test "$covered_lines" -gt 0 @@ -128,9 +122,10 @@ jobs: verbose: true - name: Upload test results to Codecov - uses: codecov/test-results-action@v1 + uses: codecov/codecov-action@v5 with: use_oidc: true - file: test-results.xml + files: test-results.xml + report_type: test_results disable_search: true fail_ci_if_error: true