Skip to content

Commit

Permalink
add job on PRs to report coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-weiner committed Jan 7, 2024
1 parent 5622b87 commit b07c3d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/ci-testing.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
name: Regression Testing
name: CI Testing & Coverage

on:
pull_request:
branches: [ "main" ]

jobs:
e2e:
coverage:
permissions:
checks: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
- name: Determine PR Number
uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Install Dependencies
run: npm ci
- name: Execute Tests
run: npm test
- name: Execute UTs
run: npm run test-ci
- name: Report Coverage
uses: ArtiomTr/jest-coverage-report-action@v2
with:
annotations: none
custom-title: CI Testing Coverage
prnumber: ${{ steps.findPr.outputs.number }}
test-script: npm run test:ci

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
},
"scripts": {
"pack:dry": "npm pack --dry-run",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage"
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
"test:ci": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest --ci --json --coverage --testLocationInResults --outputFile=report.json"
},
"dependencies": {
"axios": "^1.6.3",
Expand Down

0 comments on commit b07c3d9

Please sign in to comment.