Skip to content

Commit 042333f

Browse files
committed
build: update gcovr to 7.2 and codecov config
1 parent fcda284 commit 042333f

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

.github/workflows/coverage-linux-without-intl.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- tools/gyp/**
1313
- tools/test.py
1414
- .github/workflows/coverage-linux-without-intl.yml
15+
- codecov.yml
1516
push:
1617
branches:
1718
- main
@@ -24,6 +25,7 @@ on:
2425
- tools/gyp/**
2526
- tools/test.py
2627
- .github/workflows/coverage-linux-without-intl.yml
28+
- codecov.yml
2729

2830
concurrency:
2931
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -58,7 +60,7 @@ jobs:
5860
- name: Environment Information
5961
run: npx envinfo
6062
- name: Install gcovr
61-
run: pip install gcovr==4.2
63+
run: pip install gcovr==7.2
6264
- name: Build
6365
run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --coverage --without-intl"
6466
# TODO(bcoe): fix the couple tests that fail with the inspector enabled.
@@ -70,7 +72,7 @@ jobs:
7072
env:
7173
NODE_OPTIONS: --max-old-space-size=8192
7274
- name: Report C++
73-
run: cd out && gcovr --gcov-exclude='.*\b(deps|usr|out|obj|cctest|embedding)\b' -v -r Release/obj.target --xml -o ../coverage/coverage-cxx.xml --root=$(cd ../ && pwd)
75+
run: gcovr --object-directory=out -v --filter src --xml -o ./coverage/coverage-cxx.xml --root=./ --gcov-executable="llvm-cov-18 gcov"
7476
# Clean temporary output from gcov and c8, so that it's not uploaded:
7577
- name: Clean tmp
7678
run: rm -rf coverage/tmp && rm -rf out

.github/workflows/coverage-linux.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- tools/gyp/**
1313
- tools/test.py
1414
- .github/workflows/coverage-linux.yml
15+
- codecov.yml
1516
push:
1617
branches:
1718
- main
@@ -24,6 +25,7 @@ on:
2425
- tools/gyp/**
2526
- tools/test.py
2627
- .github/workflows/coverage-linux.yml
28+
- codecov.yml
2729

2830
concurrency:
2931
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -58,7 +60,7 @@ jobs:
5860
- name: Environment Information
5961
run: npx envinfo
6062
- name: Install gcovr
61-
run: pip install gcovr==4.2
63+
run: pip install gcovr==7.2
6264
- name: Build
6365
run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --coverage"
6466
# TODO(bcoe): fix the couple tests that fail with the inspector enabled.
@@ -70,7 +72,7 @@ jobs:
7072
env:
7173
NODE_OPTIONS: --max-old-space-size=8192
7274
- name: Report C++
73-
run: cd out && gcovr --gcov-exclude='.*\b(deps|usr|out|obj|cctest|embedding)\b' -v -r Release/obj.target --xml -o ../coverage/coverage-cxx.xml --root=$(cd ../ && pwd)
75+
run: gcovr --object-directory=out -v --filter src --xml -o ./coverage/coverage-cxx.xml --root=./ --gcov-executable="llvm-cov-18 gcov"
7476
# Clean temporary output from gcov and c8, so that it's not uploaded:
7577
- name: Clean tmp
7678
run: rm -rf coverage/tmp && rm -rf out

.github/workflows/coverage-windows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- tools/gyp/**
1313
- tools/test.py
1414
- .github/workflows/coverage-windows.yml
15+
- codecov.yml
1516
push:
1617
branches:
1718
- main
@@ -24,6 +25,7 @@ on:
2425
- tools/gyp/**
2526
- tools/test.py
2627
- .github/workflows/coverage-windows.yml
28+
- codecov.yml
2729

2830
concurrency:
2931
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report.
253253
.PHONY: coverage-build
254254
coverage-build: all
255255
-$(MAKE) coverage-build-js
256-
if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==4.2; fi
256+
if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==7.2; fi
257257
$(MAKE)
258258

259259
.PHONY: coverage-build-js
@@ -269,9 +269,10 @@ coverage-test: coverage-build
269269
-NODE_V8_COVERAGE=coverage/tmp \
270270
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
271271
$(MAKE) coverage-report-js
272-
-(cd out && PYTHONPATH=../gcovr $(PYTHON) -m gcovr \
273-
--gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \
274-
-r ../src/ --object-directory Release/obj.target \
272+
-(PYTHONPATH=./gcovr $(PYTHON) -m gcovr \
273+
--object-directory=out \
274+
--filter src -v \
275+
--root ./ \
275276
--html --html-details -o ../coverage/cxxcoverage.html \
276277
--gcov-executable="$(GCOV)")
277278
@printf "Javascript coverage %%: "

codecov.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# TODO(bcoe): re-enable coverage report comments, once we can figure out
2-
# how to make them more accurate for the Node.js project,
3-
# See: https://github.com/nodejs/node/issues/35759
4-
comment: false
5-
# # Only show diff and files changed:
6-
# layout: "diff, files"
7-
# # Don't post if no changes in coverage:
8-
# require_changes: true
1+
comment:
2+
# Only show diff and files changed:
3+
layout: diff, files
4+
# Don't post if no changes in coverage:
5+
require_changes: true
96

107
codecov:
118
branch: main
129
notify:
1310
# Wait for all coverage builds:
11+
# - coverage-linux.yml
12+
# - coverage-windows.yml [manually disabled see #50489]
13+
# - coverage-linux-without-intl.yml
1414
after_n_builds: 2
1515

1616
coverage:
17+
# Useful for blocking Pull Requests that don't meet a particular coverage threshold.
1718
status:
1819
project: off
1920
patch: off

0 commit comments

Comments
 (0)