chore: add coverage report comment (#5716)

This commit is contained in:
hiento09 2025-07-07 11:37:57 +07:00 committed by GitHub
parent 3287e8b300
commit 641275ee79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,6 +42,8 @@ jobs:
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
@ -65,17 +67,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ref-lcov.info
path: ./coverage/merged/lcov.info
- name: Generate Code Coverage report
id: code-coverage
uses: barecheck/code-coverage-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: './coverage/merged/lcov.info'
base-lcov-file: './coverage/merged/lcov.info'
send-summary-comment: true
show-annotations: 'warning'
path: coverage/merged/lcov.info
test-on-macos:
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:
name: playwright-report
path: electron/playwright-report/
retention-days: 2
coverage-check:
runs-on: ubuntu-latest
needs: base_branch_cov
continue-on-error: true
steps:
- name: Getting the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Installing node
uses: actions/setup-node@v3
with:
node-version: 20
- name: 'Cleanup cache'
continue-on-error: true
run: |
rm -rf ~/jan
make clean
- name: Install dependencies
run: |
make lint
- name: Run test coverage
run: |
yarn test:coverage
- name: Download code coverage report from base branch
uses: actions/download-artifact@v4
with:
name: ref-lcov.info
- name: Generate Code Coverage report
id: code-coverage
uses: barecheck/code-coverage-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: './coverage/merged/lcov.info'
base-lcov-file: './lcov.info'
send-summary-comment: true
show-annotations: 'warning'