From 83b68f4c21c9bc3bca5af9f2862c56c624043c89 Mon Sep 17 00:00:00 2001 From: Dick Wolff <5620002+dickwolff@users.noreply.github.com> Date: Sat, 30 Dec 2023 00:18:29 +0100 Subject: [PATCH] Publish coverage results on PR and job --- .github/workflows/main.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be02889..66da7fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,11 +6,29 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: '20' + - run: npm install + - run: npm run test - - uses: irongut/CodeCoverageSummary@v1.3.0 + + - name: Convert code coverage results + uses: irongut/CodeCoverageSummary@v1.3.0 with: filename: coverage/*.xml + badge: true + format: 'markdown' + output: 'both' + + - name: Add code coverage PR comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: coverage/results.md + + - name: Write to job summary + run: cat coverage/results.md >> $GITHUB_STEP_SUMMARY