ci: flash analysis updates

* updates comment instead of posting a new one each time
* runs on dronecode infra
This commit is contained in:
Ramon Roche
2024-11-22 04:57:46 -08:00
parent 14fe6c2167
commit 14468d49c1
+43 -33
View File
@@ -10,8 +10,8 @@ on:
jobs:
analyze_flash:
name: FLASH usage analysis
runs-on: ubuntu-latest
name: Analyzing ${{ matrix.target }}
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
container:
image: px4io/px4-dev-nuttx-focal
strategy:
@@ -29,7 +29,7 @@ jobs:
- name: Git ownership workaround
run: git config --system --add safe.directory '*'
- name: Build
- name: Build Target
run: make ${{ matrix.target }}
- name: Store the ELF with the change
@@ -73,36 +73,46 @@ jobs:
echo "$EOF" >> $GITHUB_OUTPUT
post_pr_comment:
name: Post PR comment
runs-on: ubuntu-latest
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]
if: ${{ github.event.pull_request }}
steps:
- name: If it's a PR add a comment with the bloaty output
if: ${{ github.event.pull_request }}
uses: actions/github-script@v6
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
script: |
const comment = [
'## FLASH Analysis',
'<details>',
'<summary>px4_fmu-v5x</summary>',
'',
'```',
`${{ needs.analyze_flash.outputs.px4_fmu-v5x }}`,
'```',
'</details>',
'',
'<details>',
'<summary>px4_fmu-v6x</summary>',
'',
'```',
`${{ needs.analyze_flash.outputs.px4_fmu-v6x }}`,
'```',
'</details>'
]
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment.join('\n')
})
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: FLASH Analysis
- name: Set Build Time
id: bt
run: |
echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
- name: Create or update comment
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
<details>
<summary>px4_fmu-v5x</summary>
```
${{ needs.analyze_flash.outputs.px4_fmu-v5x }}
```
</details>
<details>
<summary>px4_fmu-v6x</summary>
```
${{ needs.analyze_flash.outputs.px4_fmu-v6x }}
```
</details>
**Updated: _${{ steps.bt.outputs.timestamp }}_**
edit-mode: replace