forked from inikulin/parse5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Add coverage reporting (inikulin#515)
- Loading branch information
Showing
2 changed files
with
21 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 |
---|---|---|
|
@@ -6,9 +6,13 @@ on: | |
- 'dependabot/**' | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CI: true | ||
FORCE_COLOR: 2 | ||
NODE_COV: 16 # The Node.js version to run coveralls on | ||
|
||
jobs: | ||
lint: | ||
|
@@ -27,14 +31,17 @@ jobs: | |
test: | ||
name: Node ${{ matrix.node }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write # for coverallsapp/github-action to create new checks | ||
contents: read # for actions/checkout to fetch code | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: | ||
- 12 | ||
- 14 | ||
- 16 | ||
- 18 | ||
- lts/* | ||
|
||
steps: | ||
|
@@ -52,3 +59,15 @@ jobs: | |
|
||
- name: Run Tests | ||
run: npm run unit-tests | ||
if: matrix.node != env.NODE_COV | ||
|
||
- name: Run Jest with coverage | ||
run: npm run unit-tests -- --coverage | ||
if: matrix.node == env.NODE_COV | ||
|
||
- name: Run Coveralls | ||
uses: coverallsapp/[email protected] | ||
if: matrix.node == env.NODE_COV | ||
continue-on-error: true | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' |
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