-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add basic coverage support (#1451)
* test: add basic coverage support * test: introduce codecov.io service support Separate reporting into coverage creation and report generation (XML, HTML) steps. Upload XML results to codecov.io. * ci: run coverage on drafts; remove html coverage report artifact upload --------- Co-authored-by: Kevin Eady <[email protected]>
- Loading branch information
1 parent
089f1dc
commit 0c46940
Showing
3 changed files
with
74 additions
and
0 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,64 @@ | ||
name: Coverage Linux | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths-ignore: | ||
- '**.md' | ||
- benchmark/** | ||
- doc/** | ||
- tools/** | ||
- unit-test/** | ||
- .github/** | ||
- '!.github/workflows/coverage-linux.yml' | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
- benchmark/** | ||
- doc/** | ||
- tools/** | ||
- unit-test/** | ||
- .github/** | ||
- '!.github/workflows/coverage-linux.yml' | ||
|
||
env: | ||
PYTHON_VERSION: '3.11' | ||
NODE_VERSION: '20.x' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
coverage-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
persist-credentials: false | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Use Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Environment Information | ||
run: npx envinfo | ||
- name: Install gcovr | ||
run: pip install gcovr==6.0 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Test with coverage | ||
run: | | ||
npm run create-coverage | ||
- name: Generate coverage report (XML) | ||
run: | | ||
npm run report-coverage-xml | ||
- name: Upload | ||
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 | ||
with: | ||
directory: ./coverage-xml | ||
token: ${{ secrets.CODECOV_TOKEN }} # To bypass public API rate limiting, see https://github.com/codecov/codecov-action/issues/557 |
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
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