File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -61,19 +61,41 @@ jobs:
6161 npm ci
6262 npm run coverage
6363 mv coverage/coverage-summary.json ${{ runner.temp }}/coverage-main-summary.json
64+
65+ - name : Upload Artifact (main)
66+ uses : actions/upload-artifact@v4
67+ if : github.event_name != 'pull_request'
68+ with :
69+ name : coverage-report
70+ path : coverage
71+ retention-days : 14
6472
6573 - name : Checkout PR Branch
74+ if : github.event_name == 'pull_request'
6675 uses : actions/checkout@v4
6776 with :
6877 clean : true
6978
7079 - name : Install & Test (PR)
80+ if : github.event_name == 'pull_request'
7181 run : |
7282 npm ci
7383 npm run coverage
84+
85+ - name : Upload Artifact (PR)
86+ id : upload-artifact-pr
87+ uses : actions/upload-artifact@v4
88+ if : github.event_name == 'pull_request'
89+ with :
90+ name : coverage-report
91+ path : coverage
92+ retention-days : 14
7493
75- - name : Report Coverage Delta
94+ - name : Post Comment
7695 uses : actions/github-script@v6
96+ if : github.event_name == 'pull_request'
97+ env :
98+ ARTIFACT_URL : ${{ steps.upload-artifact-pr.outputs.artifact-url }}
7799 with :
78100 script : |
79101 const fs = require('fs');
83105 };
84106
85107 let markdown = `### 🧪 Code Coverage Delta\n\n`;
108+ markdown += `[⬇️ **Download HTML Report**](${artifactUrl})\n\n`;
86109 markdown += `| Metric | Main | PR | Delta |\n`;
87110 markdown += `| :--- | :---: | :---: | :---: |\n`;
88111
You can’t perform that action at this time.
0 commit comments