Skip to content

Commit

Permalink
ci: NPF-2894 add code coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
stas-nc committed Aug 11, 2023
1 parent 1b9c709 commit ab168b4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,29 @@ jobs:
run: docker run namecheap/ilc_tmp:$SHA npm run test:ci

- name: Run server-side tests coverage
run: docker run --volume /artifacts/ilc/.test_output/server:/temporary namecheap/ilc_tmp:$SHA bash -c "npm run test:coverage && mv .nyc_output/* /temporary"
run: docker run --volume $(pwd)/artifacts/ilc/.test_output/server:/temporary namecheap/ilc_tmp:$SHA bash -c "npm run test:coverage && mv .nyc_output/* /temporary"

- uses: actions/upload-artifact@v2
with:
name: server-side-tests-artifacts
path: /artifacts/ilc/.test_output/server/
path: ./artifacts/ilc/.test_output/server/

- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: ./artifacts/**/cobertura-coverage.xml
badge: true
format: markdown
indicators: true
output: both
thresholds: '80 95'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md

- name: Build the Docker image to test client-side
run: |
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Ignore artifacts:
ilc/public
.nyc_output
2 changes: 1 addition & 1 deletion ilc/nyc.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');

module.exports = {
all: true,
reporter: ['html', 'text'],
reporter: ['html', 'text', 'cobertura', 'json-summary'],
'check-coverage': true,

branches: 0,
Expand Down
7 changes: 1 addition & 6 deletions registry/.nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@
"check-coverage": true,
"lines": 90,
"per-file": true,
"exclude": [
"**/*.spec.ts",
"config",
"build",
"node_modules"
]
"exclude": ["**/*.spec.ts", "config", "build", "node_modules"]
}

0 comments on commit ab168b4

Please sign in to comment.