Skip to content

Commit

Permalink
ci/cd: added github actions for test and code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-shuvo committed Oct 21, 2022
1 parent 11056d4 commit 7d7dfe5
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/codecov.yml
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

0 comments on commit 7d7dfe5

Please sign in to comment.