Membrowse Zephyr Report #1680
This file contains hidden or 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
| name: Membrowse Zephyr Report | |
| # Triggered after the heavy Zephyr 4.x test workflow completes. Pulls the | |
| # pre-built zephyr.elf, zephyr.map and linker.cmd artifacts staged by | |
| # zephyr-test.sh and feeds them to the Membrowse memory-tracking service. | |
| # This avoids duplicating the (slow) Zephyr build inside the Membrowse | |
| # matrix. | |
| on: | |
| workflow_run: | |
| workflows: [Zephyr 4.x tests] | |
| types: | |
| - completed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.workflow_run.head_sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| # Only run from the wolfssl org to avoid burning forks' CI minutes | |
| # and reporting fork builds to the membrowse backend. | |
| if: > | |
| github.event.workflow_run.conclusion == 'success' && | |
| github.repository_owner == 'wolfssl' | |
| permissions: | |
| contents: read | |
| actions: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target_name: zephyr-native_sim | |
| artifact: membrowse-zephyr-native_sim | |
| - target_name: zephyr-frdm_rw612 | |
| artifact: membrowse-zephyr-frdm_rw612 | |
| steps: | |
| # Check out the commit the Zephyr workflow actually built so Membrowse | |
| # attributes the report to the right commit. Only the last 2 commits | |
| # are needed (current + parent) to resolve the base for comparison. | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.event.workflow_run.head_sha }} | |
| fetch-depth: 2 | |
| persist-credentials: false | |
| - name: Download Zephyr build artifact | |
| id: download | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: zephyr-artifacts/${{ matrix.target_name }} | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| continue-on-error: true | |
| - name: Verify artifact present | |
| id: verify | |
| run: | | |
| ELF="zephyr-artifacts/${{ matrix.target_name }}/zephyr.elf" | |
| LD="zephyr-artifacts/${{ matrix.target_name }}/linker.cmd" | |
| MAP="zephyr-artifacts/${{ matrix.target_name }}/zephyr.map" | |
| if [[ -f "$ELF" && -f "$LD" ]]; then | |
| echo "have_artifacts=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "have_artifacts=false" >> "$GITHUB_OUTPUT" | |
| echo "::warning::Membrowse artifact for ${{ matrix.target_name }} not found; the matching cell of zephyr-4.x.yml may have been skipped or excluded." | |
| fi | |
| # The map file is optional; it enables library/object attribution. | |
| if [[ -f "$MAP" ]]; then | |
| echo "map_file=$MAP" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "map_file=" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run Membrowse PR Action | |
| if: steps.verify.outputs.have_artifacts == 'true' | |
| # Pinned to a full commit SHA: this job downloads fork-controlled | |
| # artifacts and holds MEMBROWSE_API_KEY, so a moved tag must not be | |
| # able to swap the action out from under it. v1.2.9. | |
| uses: membrowse/membrowse-action@3f23ea562abaa6614855d6be5ec83b3cd1d274dd | |
| with: | |
| target_name: ${{ matrix.target_name }} | |
| elf: zephyr-artifacts/${{ matrix.target_name }}/zephyr.elf | |
| ld: zephyr-artifacts/${{ matrix.target_name }}/linker.cmd | |
| map_file: ${{ steps.verify.outputs.map_file }} | |
| linker_vars: "" | |
| api_key: ${{ secrets.MEMBROWSE_API_KEY }} | |
| api_url: ${{ vars.MEMBROWSE_API_URL }} | |
| verbose: INFO | |
| # Refresh the consolidated Membrowse PR comment after the Zephyr targets | |
| # have been submitted, mirroring membrowse-comment.yml. | |
| post-comment: | |
| needs: analyze | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| if: > | |
| github.event.workflow_run.event == 'pull_request' && | |
| github.repository_owner == 'wolfssl' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Post Membrowse PR comment | |
| if: ${{ env.MEMBROWSE_API_KEY != '' }} | |
| # Pinned to a full commit SHA, same rationale as the analyze job. v1.2.9. | |
| uses: membrowse/membrowse-action/comment-action@3f23ea562abaa6614855d6be5ec83b3cd1d274dd | |
| with: | |
| api_key: ${{ secrets.MEMBROWSE_API_KEY }} | |
| commit: ${{ github.event.workflow_run.head_sha }} | |
| env: | |
| MEMBROWSE_API_KEY: ${{ secrets.MEMBROWSE_API_KEY }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |