diff --git a/.github/actions/memory-report/action.yml b/.github/actions/memory-report/action.yml index ce6273ea..139cd83b 100644 --- a/.github/actions/memory-report/action.yml +++ b/.github/actions/memory-report/action.yml @@ -5,6 +5,11 @@ inputs: branch: required: true +outputs: + report: + description: "A raw memory usage report" + value: ${{ steps.make_report.outputs.report }} + runs: using: "composite" steps: @@ -14,10 +19,11 @@ runs: submodules: recursive ref: ${{ inputs.branch }} - name: Report + id: make_report shell: bash run: | make test - cat build/test/unit/*.size > build/memory-report-${{ inputs.branch }}.txt + echo "report=$(cat build/test/unit/*.size)" >> $GITHUB_OUTPUT - name: Upload uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/memory.yml b/.github/workflows/memory.yml index ba371387..83fa26c0 100644 --- a/.github/workflows/memory.yml +++ b/.github/workflows/memory.yml @@ -19,10 +19,12 @@ jobs: submodules: recursive - name: Generate memory usage report (current branch) + id: head uses: ./.github/actions/memory-report with: branch: ${{ github.head_ref }} - name: Generate memory usage report (target branch) + id: base uses: ./.github/actions/memory-report with: branch: ${{ github.base_ref }} @@ -32,18 +34,23 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - + - name: Compare run: | + echo "$BASE_REPORT" > base_report.txt + echo "$HEAD_REPORT" > head_report.txt python3 -m pip install -r scripts/ci/reports/requirements.txt python3 scripts/ci/reports/parse-reports.py \ - build/memory-report-${{ github.head_ref }}.txt \ - build/memory-report-${{ github.base_ref }}.txt \ + base_report.txt \ + head_report.txt \ report - name: Comment memory usage tables uses: GrantBirki/comment@v2.1.0 with: file: report.md + env: + BASE_REPORT: ${{ steps.base.outputs.report }} + HEAD_REPORT: ${{ steps.head.outputs.report }}