-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/cd: added github actions for test and code coverage
- Loading branch information
1 parent
11056d4
commit 7d7dfe5
Showing
1 changed file
with
22 additions
and
5 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 |
---|---|---|
@@ -1,11 +1,28 @@ | ||
name: Codecov | ||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Code coverage-reporter | ||
uses: tj-actions/coverage-reporter@v5.1 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Node 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
coverage-command: "nyc --reporter=text mocha --exclude='fixtures' __tests__/*.js" | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests and collect coverage | ||
run: npm run test -- --coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
directory: ./ | ||
files: ./coverage.lcov | ||
flags: unittests | ||
verbose: true | ||
fail_ci_if_error: true |