mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-08 08:37:38 +03:00
Compare commits
1 Commits
74d28daf42
...
79f64603ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79f64603ef |
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -86,14 +86,7 @@ jobs:
|
|||||||
if [ -n "$flash_line" ]; then echo "- ${flash_line}"; else echo "- Flash: not found"; fi
|
if [ -n "$flash_line" ]; then echo "- ${flash_line}"; else echo "- Flash: not found"; fi
|
||||||
} >> "$GITHUB_STEP_SUMMARY"
|
} >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
- name: Upload firmware.bin artifact
|
- name: Comment PR with firmware stats
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ github.event_name == 'pull_request' && format('firmware-bin-pr-{0}-{1}', github.event.pull_request.number, github.sha) || format('firmware-bin-{0}', github.sha) }}
|
|
||||||
path: .pio/build/default/firmware.bin
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Comment PR with firmware stats and firmware.bin
|
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
@ -101,27 +94,7 @@ jobs:
|
|||||||
const marker = '<!-- firmware-stats -->';
|
const marker = '<!-- firmware-stats -->';
|
||||||
const ram = `${{ steps.fw_stats.outputs.ram_line }}`.trim();
|
const ram = `${{ steps.fw_stats.outputs.ram_line }}`.trim();
|
||||||
const flash = `${{ steps.fw_stats.outputs.flash_line }}`.trim();
|
const flash = `${{ steps.fw_stats.outputs.flash_line }}`.trim();
|
||||||
const prNumber = context.payload.pull_request?.number;
|
const body = `${marker}\n**Firmware build stats**\n\n\`\`\`\n${ram || 'RAM: not found'}\n${flash || 'Flash: not found'}\n\`\`\``;
|
||||||
const artifactName = prNumber
|
|
||||||
? `firmware-bin-pr-${prNumber}-${context.sha}`
|
|
||||||
: `firmware-bin-${context.sha}`;
|
|
||||||
let firmwareLine = 'Firmware: artifact not found';
|
|
||||||
try {
|
|
||||||
const { data: artifacts } = await github.rest.actions.listWorkflowRunArtifacts({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
run_id: context.runId,
|
|
||||||
});
|
|
||||||
const firmwareArtifact = artifacts.artifacts.find((artifact) => artifact.name === artifactName);
|
|
||||||
if (firmwareArtifact) {
|
|
||||||
firmwareLine = `Firmware: [firmware.bin artifact](${firmwareArtifact.archive_download_url})`;
|
|
||||||
} else {
|
|
||||||
firmwareLine = `Firmware: artifact not found (${artifactName})`;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
firmwareLine = `Firmware: artifact lookup failed (${error.message})`;
|
|
||||||
}
|
|
||||||
const body = `${marker}\n**Firmware build stats**\n\n\`\`\`\n${ram || 'RAM: not found'}\n${flash || 'Flash: not found'}\n\`\`\`\n\n**Firmware binary**\n${firmwareLine}`;
|
|
||||||
const { data: comments } = await github.rest.issues.listComments({
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user