-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a60551
commit 33d1bd2
Showing
2 changed files
with
42 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
name: Code Size Report | ||
name: Code Report | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: 'The pull request number' | ||
required: true | ||
|
||
permissions: | ||
pull-requests: write | ||
workflow_run: | ||
workflows: ['🔥 Firmware Build'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
code-size-report: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
download-artifact: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: '📝 Generate report' | ||
id: generate_report | ||
- name: '↓ Download code size report' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "code-size-report.md" | ||
path: ${GITHUB_WORKSPACE} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ github.token }} | ||
|
||
- name: '📝 Check report' | ||
run: | | ||
CODE_SIZE_REPORT=code_size_report.md | ||
echo "Test" > ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT} | ||
ls -1 -R | ||
CODE_SIZE_REPORT=${GITHUB_WORKSPACE}/code_size_report.md | ||
cat ${CODE_SIZE_REPORT} | ||
PR_NUMBER=$(jq -r '.workflow_run.pull_requests[0].number' < "$GITHUB_EVENT_PATH") | ||
echo "Pull Request Number: $PR_NUMBER" | ||
if [ -s ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT} ]; then | ||
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT | ||
echo "code_size_report=${CODE_SIZE_REPORT}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: '📝 Post report' | ||
if: steps.generate_report.outputs.code_size_report != '' | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
pr_number: ${{ github.event.pull_request.number }} | ||
filePath: ${{ github.workspace }}/${{ steps.generate_report.outputs.code_size_report }} | ||
pr_number: ${{ steps.generate_report.outputs.pr_number }} | ||
filePath: ${{ steps.generate_report.outputs.code_size_report }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters