GeezerVison is showing github.com — build: add GitHub Action for code coverage · nodejs/node@bb2945e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +41Lines changed: 41 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +# TODO(bcoe): add similar job for Windows coverage. |
| 2 | +name: coverage-linux |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + |
| 10 | +env: |
| 11 | + PYTHON_VERSION: 3.9 |
| 12 | + FLAKY_TESTS: dontcare |
| 13 | + |
| 14 | +jobs: |
| 15 | + # TODO(bcoe): add support for C++ coverage. |
| 16 | + coverage-linux: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + - name: Set up Python ${{ env.PYTHON_VERSION }} |
| 21 | + uses: actions/setup-python@v2 |
| 22 | + with: |
| 23 | + python-version: ${{ env.PYTHON_VERSION }} |
| 24 | + - name: Environment Information |
| 25 | + run: npx envinfo |
| 26 | + - name: Build |
| 27 | + run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" |
| 28 | + # TODO(bcoe): fix the couple tests that fail with the inspector enabled. |
| 29 | + # The cause is most likely coverage's use of the inspector. |
| 30 | + - name: Test |
| 31 | + run: NODE_V8_COVERAGE=coverage/tmp make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" || exit 0 |
| 32 | + - name: Report |
| 33 | + run: npx c8 report --check-coverage |
| 34 | + - name: Output file count |
| 35 | + run: ls -l coverage/tmp/ | wc -l |
| 36 | + - name: Clean tmp |
| 37 | + run: rm -rf coverage/tmp |
| 38 | + - name: Upload |
| 39 | + uses: codecov/codecov-action@v1 |
| 40 | + with: |
| 41 | + directory: ./coverage |
Collapse file
Copy file name to clipboard +17-3Lines changed: 17 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "exclude": [ |
3 | | - "**/internal/process/write-coverage.js" |
| 3 | + "coverage/**", |
| 4 | + "test/**", |
| 5 | + "tools/**", |
| 6 | + "benchmark/**", |
| 7 | + "deps/**" |
4 | 8 | ], |
5 | | - "compact": false, |
6 | | - "reporter": ["html", "text"] |
| 9 | + "reporter": [ |
| 10 | + "html", |
| 11 | + "text", |
| 12 | + "lcov" |
| 13 | + ], |
| 14 | + "lines": 95, |
| 15 | + "branches": "93", |
| 16 | + "statements": "95", |
| 17 | + "temp-directory": "coverage/tmp", |
| 18 | + "omit-relative": false, |
| 19 | + "resolve": "./lib", |
| 20 | + "wrapper-length": 0 |
7 | 21 | } |