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: jobs:
analyze_flash: analyze_flash:
name: FLASH usage analysis name: Analyzing ${{ matrix.target }}
runs-on: ubuntu-latest runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
container: container:
image: px4io/px4-dev-nuttx-focal image: px4io/px4-dev-nuttx-focal
strategy: strategy:
@@ -29,7 +29,7 @@ jobs:
- name: Git ownership workaround - name: Git ownership workaround
run: git config --system --add safe.directory '*' run: git config --system --add safe.directory '*'
- name: Build - name: Build Target
run: make ${{ matrix.target }} run: make ${{ matrix.target }}
- name: Store the ELF with the change - name: Store the ELF with the change
@@ -73,36 +73,46 @@ jobs:
echo "$EOF" >> $GITHUB_OUTPUT echo "$EOF" >> $GITHUB_OUTPUT
post_pr_comment: post_pr_comment:
name: Post PR comment name: Publish Results
runs-on: ubuntu-latest runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
needs: [analyze_flash] needs: [analyze_flash]
if: ${{ github.event.pull_request }}
steps: steps:
- name: If it's a PR add a comment with the bloaty output - name: Find Comment
if: ${{ github.event.pull_request }} uses: peter-evans/find-comment@v3
uses: actions/github-script@v6 id: fc
with: with:
script: | issue-number: ${{ github.event.pull_request.number }}
const comment = [ comment-author: 'github-actions[bot]'
'## FLASH Analysis', body-includes: FLASH Analysis
'<details>',
'<summary>px4_fmu-v5x</summary>', - name: Set Build Time
'', id: bt
'```', run: |
`${{ needs.analyze_flash.outputs.px4_fmu-v5x }}`, echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
'```',
'</details>', - name: Create or update comment
'', uses: peter-evans/create-or-update-comment@v4
'<details>', with:
'<summary>px4_fmu-v6x</summary>', comment-id: ${{ steps.fc.outputs.comment-id }}
'', issue-number: ${{ github.event.pull_request.number }}
'```', body: |
`${{ needs.analyze_flash.outputs.px4_fmu-v6x }}`, ## FLASH Analysis
'```', <details>
'</details>' <summary>px4_fmu-v5x</summary>
]
github.rest.issues.createComment({ ```
issue_number: context.issue.number, ${{ needs.analyze_flash.outputs.px4_fmu-v5x }}
owner: context.repo.owner, ```
repo: context.repo.repo, </details>
body: comment.join('\n')
}) <details>
<summary>px4_fmu-v6x</summary>
```
${{ needs.analyze_flash.outputs.px4_fmu-v6x }}
```
</details>
**Updated: _${{ steps.bt.outputs.timestamp }}_**
edit-mode: replace