Skip to content

Commit 0d866cc

Browse files
committed
ci: generate build summary
Signed-off-by: Yi Huang <[email protected]>
1 parent da9aa9d commit 0d866cc

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Diff for: .github/workflows/build.yml

+46
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,49 @@ jobs:
3030
plugins: ${{ toJSON(matrix.plugins) }}
3131
version: ${{ needs.get-versions.outputs.version }}
3232
secrets: inherit
33+
34+
check-artifacts:
35+
needs:
36+
- get-versions
37+
- parse-plugins
38+
- linux
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: actions/github-script@v7
43+
with:
44+
script: |
45+
const fs = require("fs");
46+
const raw = JSON.parse(fs.readFileSync(".github/plugins.json"));
47+
48+
core.summary.addHeading('Build Summary');
49+
50+
let table = [
51+
[{data: 'plugin/platform', header: true}],
52+
];
53+
let platforms = [];
54+
Object.entries(raw.platforms).forEach(([key, platform]) => {
55+
table[0].push({data: key, header: true});
56+
platforms.push(platform.asset_tag);
57+
});
58+
59+
let artifacts = await github
60+
.paginate(github.rest.actions.listWorkflowRunArtifacts, {
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
run_id: context.runId,
64+
});
65+
66+
Object.keys(raw.plugins).forEach((plugin) => {
67+
let row = [{data: plugin, header: true}];
68+
let filtered = artifacts.filter((artifact) => artifact.name.includes(plugin));
69+
platforms.forEach((tag) => {
70+
row.push({
71+
data: filtered.some((artifact) => artifact.name.includes(tag)) ? ':ok:' : ':x:'
72+
});
73+
});
74+
table.push(row);
75+
});
76+
77+
core.summary.addTable(table);
78+
core.summary.write()

0 commit comments

Comments
 (0)