-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added various features to flash analysis #24072
base: main
Are you sure you want to change the base?
Conversation
…w, summary in comment output, newer bloaty version, only add comment if change is large enough, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice additions!
I left some comments, mainly focused on readability/maintainability for whoever comes after us and tries to figure this out
run: make ${{ matrix.target }} | ||
# Use special flash-analysis target if present. Otherwise fall back to the default target. | ||
run: | | ||
if make list_config_targets | grep ${{ matrix.target }}_flash-analysis; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check this here? Can we hardcode the target name?
if make list_config_targets | grep ${{ matrix.target }}_flash-analysis; then | ||
cp ./build/${{ matrix.target }}_flash-analysis/${{ matrix.target }}_flash-analysis.elf ./with-change.elf | ||
else | ||
cp ./build/${{ matrix.target }}_default/${{ matrix.target }}_default.elf ./with-change.elf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you find the elf file by a wildcard search? cp ./build/**/*.elf ./with-change.elf
?
|
||
post_pr_comment: | ||
name: Publish Results | ||
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false] | ||
needs: [analyze_flash] | ||
env: | ||
V5X-SUMMARY-MAP: ${{ needs.analyze_flash.outputs.px4_fmu-v5x-bloaty-summary-map }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with the use of env
in principle, but I see how it's way cleaner than the uber-long string. I would go one step further and do the fromJSON
casting here so you avoid it everywhere else below.
V5X-SUMMARY-MAP: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v5x-bloaty-summary-map).vm-absolute) }}
V5X-SUMMARY-PERC: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v5x-bloaty-summary-map).vm-percentage) }}
V6X-SUMMARY-MAP: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v6x-bloaty-summary-map).vm-absolute) }}
V6X-SUMMARY-PERC: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v6x-bloaty-summary-map).vm-percentage) }}
@@ -92,25 +129,32 @@ jobs: | |||
echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT | |||
|
|||
- name: Create or update comment | |||
# This can't be moved to the job-level conditions, as GH actions don't allow a job-level if condition to access the env. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to using env
is to introduce a new step that sets the outputs, but it should be fine as is right now.
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
## FLASH Analysis | ||
## 🔎 FLASH Analysis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Solved Problem
There has been feedback regarding the FLASH analysis tool. This PR adds several of the requested features.
Solution
Test coverage