-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add GitHub Action for code coverage
PR-URL: #35653 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
- Loading branch information
1 parent
985efdf
commit 372d9f4
Showing
2 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# TODO(bcoe): add similar job for Windows coverage. | ||
name: coverage-linux | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
PYTHON_VERSION: 3.9 | ||
FLAKY_TESTS: dontcare | ||
|
||
jobs: | ||
# TODO(bcoe): add support for C++ coverage. | ||
coverage-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Environment Information | ||
run: npx envinfo | ||
- name: Build | ||
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" | ||
# TODO(bcoe): fix the couple tests that fail with the inspector enabled. | ||
# The cause is most likely coverage's use of the inspector. | ||
- name: Test | ||
run: NODE_V8_COVERAGE=coverage/tmp make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" || exit 0 | ||
- name: Report | ||
run: npx c8 report --check-coverage | ||
- name: Output file count | ||
run: ls -l coverage/tmp/ | wc -l | ||
- name: Clean tmp | ||
run: rm -rf coverage/tmp | ||
- name: Upload | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
directory: ./coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
{ | ||
"exclude": [ | ||
"**/internal/process/write-coverage.js" | ||
"coverage/**", | ||
"test/**", | ||
"tools/**", | ||
"benchmark/**", | ||
"deps/**" | ||
], | ||
"compact": false, | ||
"reporter": ["html", "text"] | ||
"reporter": [ | ||
"html", | ||
"text", | ||
"lcov" | ||
], | ||
"lines": 95, | ||
"branches": "93", | ||
"statements": "95", | ||
"temp-directory": "coverage/tmp", | ||
"omit-relative": false, | ||
"resolve": "./lib", | ||
"wrapper-length": 0 | ||
} |