@dragonshorn-studios/elyseum-cli 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -16681,37 +16681,44 @@ class GithubPRCommentCoverageReporter {
|
|
|
16681
16681
|
let repoName = process.env.GITHUB_REPOSITORY;
|
|
16682
16682
|
let runId = process.env.GITHUB_RUN_ID;
|
|
16683
16683
|
let markdown = `## ${commentName}\n\n`;
|
|
16684
|
-
|
|
16685
|
-
|
|
16686
|
-
diffCoverage.
|
|
16687
|
-
|
|
16688
|
-
|
|
16689
|
-
|
|
16690
|
-
if (
|
|
16691
|
-
|
|
16684
|
+
if (diffCoverage.lines.total) {
|
|
16685
|
+
// lines, functions, branches average percentage must be greater than or equal to qualityGate
|
|
16686
|
+
const qualityGateFailed = diffCoverage.lines.percent < qualityGate ||
|
|
16687
|
+
diffCoverage.functions.percent < qualityGate ||
|
|
16688
|
+
diffCoverage.branches.percent < qualityGate;
|
|
16689
|
+
let coverageQualityText = ``;
|
|
16690
|
+
if (qualityGate) {
|
|
16691
|
+
if (qualityGateFailed) {
|
|
16692
|
+
coverageQualityText += `> [!CAUTION]\n> ### Coverage Quality Gate Failed 🟥\n`;
|
|
16693
|
+
}
|
|
16694
|
+
else {
|
|
16695
|
+
coverageQualityText += `> [!TIP]\n> ### Coverage Quality Gate Passed 🟩\n`;
|
|
16696
|
+
}
|
|
16697
|
+
coverageQualityText += `> ${this.getIcon(diffCoverage.lines.percent)} Lines: ${diffCoverage.lines.percent.toFixed(2)}% (baseline: ${qualityGate}%)\n`;
|
|
16698
|
+
coverageQualityText += `> ${this.getIcon(diffCoverage.functions.percent)} Functions: ${diffCoverage.functions.percent.toFixed(2)}% (baseline: ${qualityGate}%)\n`;
|
|
16699
|
+
coverageQualityText += `> ${this.getIcon(diffCoverage.branches.percent)} Branches: ${diffCoverage.branches.percent.toFixed(2)}% (baseline: ${qualityGate}%)\n\n`;
|
|
16700
|
+
}
|
|
16701
|
+
let summary = `| Type | Total | Covered | Percent |\n`;
|
|
16702
|
+
summary += `|-----------|-------|---------|---------|\n`;
|
|
16703
|
+
summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent)} ${diffCoverage.lines.percent.toFixed(2)}% |\n`;
|
|
16704
|
+
summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent)} ${diffCoverage.functions.percent.toFixed(2)}% |\n`;
|
|
16705
|
+
summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent)} ${diffCoverage.branches.percent.toFixed(2)}% |\n`;
|
|
16706
|
+
markdown += `### Coverage Summary\n\n${summary}`;
|
|
16707
|
+
markdown += coverageQualityText;
|
|
16708
|
+
let detailsTable = `\n<details>\n<summary>Coverage Details</summary>\n\n`;
|
|
16709
|
+
detailsTable += `| File | Lines (%) | Functions (%) | Branches (%) |\n`;
|
|
16710
|
+
detailsTable += `|------|-----------|---------------|--------------|\n`;
|
|
16711
|
+
for (const file of diffCoverage.files) {
|
|
16712
|
+
detailsTable += `| ${file.file} | ${file.lines.covered}/${file.lines.total} (${file.lines.percent.toFixed(2)}%) | ${file.functions.covered}/${file.functions.total} (${this.percentOrNA(file.functions.percent)}) | ${file.branches.covered}/${file.branches.total} (${this.percentOrNA(file.branches.percent)}) |\n`;
|
|
16692
16713
|
}
|
|
16693
|
-
|
|
16694
|
-
|
|
16695
|
-
|
|
16696
|
-
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16700
|
-
let summary = `| Type | Total | Covered | Percent |\n`;
|
|
16701
|
-
summary += `|-----------|-------|---------|---------|\n`;
|
|
16702
|
-
summary += `| Lines | ${diffCoverage.lines.total} | ${diffCoverage.lines.covered} | ${this.getIcon(diffCoverage.lines.percent)} ${diffCoverage.lines.percent.toFixed(2)}% |\n`;
|
|
16703
|
-
summary += `| Functions | ${diffCoverage.functions.total} | ${diffCoverage.functions.covered} | ${this.getIcon(diffCoverage.functions.percent)} ${diffCoverage.functions.percent.toFixed(2)}% |\n`;
|
|
16704
|
-
summary += `| Branches | ${diffCoverage.branches.total} | ${diffCoverage.branches.covered} | ${this.getIcon(diffCoverage.branches.percent)} ${diffCoverage.branches.percent.toFixed(2)}% |\n`;
|
|
16705
|
-
markdown += `### Coverage Summary\n\n${summary}`;
|
|
16706
|
-
markdown += coverageQualityText;
|
|
16707
|
-
let detailsTable = `\n<details>\n<summary>Coverage Details</summary>\n\n`;
|
|
16708
|
-
detailsTable += `| File | Lines (%) | Functions (%) | Branches (%) |\n`;
|
|
16709
|
-
detailsTable += `|------|-----------|---------------|--------------|\n`;
|
|
16710
|
-
for (const file of diffCoverage.files) {
|
|
16711
|
-
detailsTable += `| ${file.file} | ${file.lines.covered}/${file.lines.total} (${file.lines.percent.toFixed(2)}%) | ${file.functions.covered}/${file.functions.total} (${this.percentOrNA(file.functions.percent)}) | ${file.branches.covered}/${file.branches.total} (${this.percentOrNA(file.branches.percent)}) |\n`;
|
|
16714
|
+
detailsTable += `\n</details>\n`;
|
|
16715
|
+
markdown += detailsTable;
|
|
16716
|
+
}
|
|
16717
|
+
else {
|
|
16718
|
+
markdown += `> [!CAUTION]\n> ### No coverage information found\n`;
|
|
16719
|
+
fs$1.writeFileSync(reportPath, markdown);
|
|
16720
|
+
return;
|
|
16712
16721
|
}
|
|
16713
|
-
detailsTable += `\n</details>\n`;
|
|
16714
|
-
markdown += detailsTable;
|
|
16715
16722
|
let reportInfo = `Report for commit ${diffCoverage.headSha}`;
|
|
16716
16723
|
if (diffCoverage.baseSha) {
|
|
16717
16724
|
reportInfo += ` against base commit ${diffCoverage.baseSha}`;
|