nuttx/.github/workflows/membrowse-comment.yml
Michael Rogov Papernov b941a715ea ci/testing: Add MemBrowse Integration
Tracking memory footprint with MemBrowse

Signed-off-by: Michael Rogov Papernov / michael@membrowse.com
2026-06-18 12:07:41 -03:00

42 lines
1.3 KiB
YAML

name: MemBrowse PR Comment
on:
workflow_run:
workflows: [MemBrowse Memory Report]
types:
- completed
jobs:
comment:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion != 'cancelled'
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install membrowse
run: pip install --no-cache-dir membrowse
- name: Post combined PR comment
if: ${{ env.MEMBROWSE_API_KEY != '' }}
env:
MEMBROWSE_API_KEY: ${{ secrets.MEMBROWSE_API_KEY }}
MEMBROWSE_API_URL: ${{ vars.MEMBROWSE_API_URL }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
SUMMARY_ARGS=("$HEAD_SHA" --api-key "$MEMBROWSE_API_KEY" --json)
if [ -n "$MEMBROWSE_API_URL" ]; then
SUMMARY_ARGS+=(--api-url "$MEMBROWSE_API_URL")
fi
membrowse summary "${SUMMARY_ARGS[@]}" > /tmp/membrowse-summary.json
python -m membrowse.utils.github_comment --summary-json /tmp/membrowse-summary.json