Skip to content

Commit

Permalink
Merge pull request #733 from LiskHQ/720-add-code-coverage
Browse files Browse the repository at this point in the history
Add code coverage
  • Loading branch information
sameersubudhi committed Feb 22, 2023
2 parents fd89f45 + 62ac430 commit fb4f19a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/branch-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Branch Code Coverage'
on:
push:
branches: ['development', feature/*, hotfix/*, main, release/*]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Check test coverage
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage-final.json
name: codecov-umbrella
verbose: true
24 changes: 24 additions & 0 deletions .github/workflows/pr-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Code Coverage
on: [pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Check test coverage
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage-final.json
name: codecov-umbrella
verbose: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[![DeepScan grade](https://deepscan.io/api/teams/6759/projects/8870/branches/113510/badge/grade.svg)](https://deepscan.io/dashboard/#view=project&tid=6759&pid=8870&bid=113510)
![GitHub issues](https://img.shields.io/github/issues-raw/liskhq/lisk-core)
![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/liskhq/lisk-core)
[![Code coverage](https://codecov.io/gh/LiskHQ/lisk-core/branch/development/graph/badge.svg?token=U0CU1XQZ52)](https://codecov.io/gh/LiskHQ/lisk-core)

Lisk is a next-generation crypto-currency and decentralized application platform, written entirely in JavaScript. The official documentation about the whole ecosystem can be found in https://lisk.com/docs.

Expand Down
17 changes: 17 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codecov:
max_report_age: 30
notify:
wait_for_ci: false
github_checks:
annotations: false
coverage:
status:
project:
default:
# basic
target: auto
threshold: 0%
base: auto
comment:
layout: 'reach, diff, flags, files'
behavior: default
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"prebuild": "if test -d dist; then rm -r dist; fi; rm -f tsconfig.tsbuildinfo; rm -f npm-shrinkwrap.json",
"build": "tsc",
"test": "jest",
"test:coverage": "jest --coverage=true --coverage-reporters=text",
"test:coverage": "jest --coverage=true --verbose --forceExit",
"test:ci": "jest --coverage=true --coverage-reporters=json --verbose",
"test:stress": "npx ts-node test/scripts/stress_test.ts",
"version": "oclif-dev readme --multi --dir=docs/commands && git add README.md docs",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["./src/**/*.ts", "./src/**/*.json"]
"include": ["./src/**/*.ts", "./src/**/*.json", "jest**config.js"]
}

0 comments on commit fb4f19a

Please sign in to comment.