diff --git a/.github/workflows/memory.yml b/.github/workflows/memory.yml index ff9b7baf..ba371387 100644 --- a/.github/workflows/memory.yml +++ b/.github/workflows/memory.yml @@ -22,11 +22,10 @@ jobs: uses: ./.github/actions/memory-report with: branch: ${{ github.head_ref }} - # TODO: Comment back in - #- name: Generate memory usage report (main) - # uses: ./.github/actions/memory-report - # with: - # branch: ${{ github.base_ref }} + - name: Generate memory usage report (target branch) + uses: ./.github/actions/memory-report + with: + branch: ${{ github.base_ref }} # To get back to the PR branch - name: Checkout @@ -36,21 +35,12 @@ jobs: - name: Compare run: | - # TODO: Must be the ones generated ofc, but for now just static to test python3 -m pip install -r scripts/ci/reports/requirements.txt python3 scripts/ci/reports/parse-reports.py \ - scripts/ci/reports/test/update.txt \ - scripts/ci/reports/test/main.txt \ + build/memory-report-${{ github.head_ref }}.txt \ + build/memory-report-${{ github.base_ref }}.txt \ report - - name: Comment - uses: gavv/pull-request-artifacts@v2.1.0 - with: - commit: ${{ github.event.pull_request.head.sha }} - repo-token: ${{ secrets.GITHUB_TOKEN }} - artifacts: report.txt - comment-title: "Memory usage report" - comment-message: "Here is an overview of how your pull request impacts the memory usage compared to the main branch:" - - name: Comment test table + - name: Comment memory usage tables uses: GrantBirki/comment@v2.1.0 with: file: report.md diff --git a/scripts/ci/reports/parse-reports.py b/scripts/ci/reports/parse-reports.py index b32e1852..636e61ba 100644 --- a/scripts/ci/reports/parse-reports.py +++ b/scripts/ci/reports/parse-reports.py @@ -52,7 +52,7 @@ def format_md_tables(update: pd.DataFrame, main: pd.DataFrame, report: pd.DataFr | bss | {main.loc[idx]['bss']} | {update.loc[idx]['bss']} | {row['bss'] : <4.2f} | | total | {main.loc[idx]['dec']} | {update.loc[idx]['dec']} | {row['dec'] : <4.2f} | """ - format_string += f"## {row['filename'].replace('_c', '.c')}\n" + table + "\n\n" + format_string += f"## {row['filename']}\n" + table + "\n\n" return format_string