Compare commits
7 Commits
epic/1.0_b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1d6c76830 | ||
|
|
87cd79774f | ||
|
|
c8b40684c8 | ||
|
|
6bacf4f605 | ||
|
|
e2dc048b2a | ||
|
|
1f219b0c85 | ||
|
|
2220644539 |
18
.github/workflows/coverage-comment.yml
vendored
18
.github/workflows/coverage-comment.yml
vendored
@ -52,10 +52,10 @@ jobs:
|
||||
}
|
||||
};
|
||||
|
||||
const mainSummary = loadSummary('./coverage-main-summary.json');
|
||||
const baseSummary = loadSummary('./coverage-base-summary.json');
|
||||
const prSummary = loadSummary('./coverage-pr-summary.json');
|
||||
|
||||
if (!mainSummary || !prSummary) {
|
||||
if (!baseSummary || !prSummary) {
|
||||
console.log("Missing coverage data, skipping comment.");
|
||||
return;
|
||||
}
|
||||
@ -81,7 +81,7 @@ jobs:
|
||||
|
||||
const fileUrl = (path) => `https://github.com/${owner}/${repo}/blob/${headSha}/${path}`;
|
||||
|
||||
const allFiles = new Set([...Object.keys(mainSummary), ...Object.keys(prSummary)]);
|
||||
const allFiles = new Set([...Object.keys(baseSummary), ...Object.keys(prSummary)]);
|
||||
allFiles.delete('total');
|
||||
const workspacePath = process.env.GITHUB_WORKSPACE ? process.env.GITHUB_WORKSPACE + '/' : '';
|
||||
|
||||
@ -89,18 +89,18 @@ jobs:
|
||||
let newRows = [];
|
||||
|
||||
for (const file of allFiles) {
|
||||
const mainFile = mainSummary[file];
|
||||
const baseFile = baseSummary[file];
|
||||
const prFile = prSummary[file];
|
||||
|
||||
if (!prFile) continue;
|
||||
|
||||
const oldPct = getPct(mainFile, metric);
|
||||
const oldPct = getPct(baseFile, metric);
|
||||
const newPct = getPct(prFile, metric);
|
||||
|
||||
const relativeFilePath = file.replace(workspacePath, '');
|
||||
const linkedPath = `[${relativeFilePath}](${fileUrl(relativeFilePath)})`;
|
||||
|
||||
if (!mainFile && prFile) {
|
||||
if (!baseFile && prFile) {
|
||||
newRows.push(`| ${linkedPath} (**new**) | — | ${newPct}% | — |\n`);
|
||||
} else if (oldPct !== newPct) {
|
||||
changedRows.push(`| ${linkedPath} | ${oldPct}% | ${newPct}% | ${formatDiff(oldPct, newPct)} |\n`);
|
||||
@ -110,7 +110,7 @@ jobs:
|
||||
if (changedRows.length === 0 && newRows.length === 0) {
|
||||
markdown += `\n_No coverage changes._\n`;
|
||||
} else {
|
||||
markdown += `| | Main | PR | Delta |\n`;
|
||||
markdown += `| | Base | PR | Delta |\n`;
|
||||
markdown += `| :--- | :---: | :---: | :---: |\n`;
|
||||
|
||||
if (changedRows.length > 0) {
|
||||
@ -120,7 +120,7 @@ jobs:
|
||||
markdown += newRows.sort().join('');
|
||||
}
|
||||
|
||||
const oldTotalPct = getPct(mainSummary.total, metric);
|
||||
const oldTotalPct = getPct(baseSummary.total, metric);
|
||||
const newTotalPct = getPct(prSummary.total, metric);
|
||||
if (oldTotalPct !== newTotalPct) {
|
||||
markdown += `| **Total** | ${oldTotalPct}% | ${newTotalPct}% | ${formatDiff(oldTotalPct, newTotalPct)} |\n`;
|
||||
@ -161,4 +161,4 @@ jobs:
|
||||
issue_number: prNumber,
|
||||
body: markdown
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
20
.github/workflows/unit-tests.yml
vendored
20
.github/workflows/unit-tests.yml
vendored
@ -5,9 +5,9 @@ name: Run Unit Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: [ "main", "epic/**" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
branches: [ "main", "epic/**" ]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
@ -54,24 +54,25 @@ jobs:
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Main
|
||||
- name: Checkout Base Branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
ref: ${{ github.event.pull_request.base.ref || 'main' }}
|
||||
clean: true
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install & Test (Main)
|
||||
- name: Install & Test (Base Branch)
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
npm ci
|
||||
npm run coverage
|
||||
mv coverage/coverage-summary.json ${{ runner.temp }}/coverage-main-summary.json
|
||||
mv coverage/coverage-summary.json ${{ runner.temp }}/coverage-base-summary.json
|
||||
|
||||
- name: Upload Artifact (main)
|
||||
- name: Upload Artifact (base)
|
||||
uses: actions/upload-artifact@v4
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
@ -92,7 +93,7 @@ jobs:
|
||||
npm ci
|
||||
npm run coverage
|
||||
mv coverage/coverage-summary.json coverage-pr-summary.json
|
||||
mv ${{ runner.temp }}/coverage-main-summary.json coverage-main-summary.json
|
||||
mv ${{ runner.temp }}/coverage-base-summary.json coverage-base-summary.json
|
||||
|
||||
- name: Save PR number
|
||||
run: |
|
||||
@ -104,9 +105,8 @@ jobs:
|
||||
with:
|
||||
name: coverage-data
|
||||
path: |
|
||||
coverage-main-summary.json
|
||||
coverage-base-summary.json
|
||||
coverage-pr-summary.json
|
||||
coverage/
|
||||
PR_NUMBER
|
||||
retention-days: 1
|
||||
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@ -5147,9 +5147,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
|
||||
"integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
|
||||
"version": "3.4.2",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
|
||||
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@ -7673,9 +7673,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.0.tgz",
|
||||
"integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==",
|
||||
"version": "7.3.2",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.2.tgz",
|
||||
"integrity": "sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
14
src/samples/package-lock.json
generated
14
src/samples/package-lock.json
generated
@ -4768,9 +4768,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/fast-xml-parser": {
|
||||
"version": "5.5.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.6.tgz",
|
||||
"integrity": "sha512-3+fdZyBRVg29n4rXP0joHthhcHdPUHaIC16cuyyd1iLsuaO6Vea36MPrxgAzbZna8lhvZeRL8Bc9GP56/J9xEw==",
|
||||
"version": "5.5.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.7.tgz",
|
||||
"integrity": "sha512-LteOsISQ2GEiDHZch6L9hB0+MLoYVLToR7xotrzU0opCICBkxOPgHAy1HxAvtxfJNXDJpgAsQN30mkrfpO2Prg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -4784,7 +4784,7 @@
|
||||
"dependencies": {
|
||||
"fast-xml-builder": "^1.1.4",
|
||||
"path-expression-matcher": "^1.1.3",
|
||||
"strnum": "^2.1.2"
|
||||
"strnum": "^2.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"fxparser": "src/cli/cli.js"
|
||||
@ -7344,9 +7344,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/strnum": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.2.tgz",
|
||||
"integrity": "sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==",
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.1.tgz",
|
||||
"integrity": "sha512-BwRvNd5/QoAtyW1na1y1LsJGQNvRlkde6Q/ipqqEaivoMdV+B1OMOTVdwR+N/cwVUcIt9PYyHmV8HyexCZSupg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user