From 641275ee7906a3b5fa9f107a5e537ea309b67a14 Mon Sep 17 00:00:00 2001 From: hiento09 <136591877+hiento09@users.noreply.github.com> Date: Mon, 7 Jul 2025 11:37:57 +0700 Subject: [PATCH] chore: add coverage report comment (#5716) --- .github/workflows/jan-linter-and-test.yml | 56 ++++++++++++++++++----- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/jan-linter-and-test.yml b/.github/workflows/jan-linter-and-test.yml index dddbd7d38..f80324b87 100644 --- a/.github/workflows/jan-linter-and-test.yml +++ b/.github/workflows/jan-linter-and-test.yml @@ -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'