Skip to content

Commit 641275e

Browse files
authored
chore: add coverage report comment (#5716)
1 parent 3287e8b commit 641275e

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed

.github/workflows/jan-linter-and-test.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
continue-on-error: true
4343
steps:
4444
- uses: actions/checkout@v3
45+
with:
46+
ref: ${{ github.base_ref }}
4547
- name: Use Node.js 20.x
4648
uses: actions/setup-node@v3
4749
with:
@@ -65,17 +67,7 @@ jobs:
6567
uses: actions/upload-artifact@v4
6668
with:
6769
name: ref-lcov.info
68-
path: ./coverage/merged/lcov.info
69-
70-
- name: Generate Code Coverage report
71-
id: code-coverage
72-
uses: barecheck/code-coverage-action@v1
73-
with:
74-
github-token: ${{ secrets.GITHUB_TOKEN }}
75-
lcov-file: './coverage/merged/lcov.info'
76-
base-lcov-file: './coverage/merged/lcov.info'
77-
send-summary-comment: true
78-
show-annotations: 'warning'
70+
path: coverage/merged/lcov.info
7971

8072
test-on-macos:
8173
runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && 'macos-latest' || 'macos-selfhosted-12-arm64' }}
@@ -231,3 +223,45 @@ jobs:
231223
name: playwright-report
232224
path: electron/playwright-report/
233225
retention-days: 2
226+
227+
coverage-check:
228+
runs-on: ubuntu-latest
229+
needs: base_branch_cov
230+
continue-on-error: true
231+
steps:
232+
- name: Getting the repo
233+
uses: actions/checkout@v3
234+
with:
235+
fetch-depth: 0
236+
237+
- name: Installing node
238+
uses: actions/setup-node@v3
239+
with:
240+
node-version: 20
241+
- name: 'Cleanup cache'
242+
continue-on-error: true
243+
run: |
244+
rm -rf ~/jan
245+
make clean
246+
247+
- name: Install dependencies
248+
run: |
249+
make lint
250+
251+
- name: Run test coverage
252+
run: |
253+
yarn test:coverage
254+
255+
- name: Download code coverage report from base branch
256+
uses: actions/download-artifact@v4
257+
with:
258+
name: ref-lcov.info
259+
- name: Generate Code Coverage report
260+
id: code-coverage
261+
uses: barecheck/code-coverage-action@v1
262+
with:
263+
github-token: ${{ secrets.GITHUB_TOKEN }}
264+
lcov-file: './coverage/merged/lcov.info'
265+
base-lcov-file: './lcov.info'
266+
send-summary-comment: true
267+
show-annotations: 'warning'

0 commit comments

Comments
 (0)