Skip to content

Commit ff861f6

Browse files
committed
Try make action
1 parent fe28f42 commit ff861f6

File tree

2 files changed

+66
-30
lines changed

2 files changed

+66
-30
lines changed

.github/actions/memory-report.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Generate memory usage report
2+
description: Generate a memory usage report for a specific branch
3+
4+
inputs:
5+
branch:
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
submodules: recursive
15+
ref: ${{ inputs.branch }}
16+
- name: Report
17+
run: |
18+
make test
19+
cat build/test/*.size > build/memory-report-${{ inputs.branch }}.txt
20+
- name: Upload
21+
uses: actions/upload-artifacts@v4
22+
with:
23+
name: Memory-report-${{ inputs.branch }}
24+
path: build/memory-report-${{ inputs.branch }}.txt

.github/workflows/memory.yml

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,52 @@ permissions:
1010
contents: write
1111
pull-requests: write
1212

13+
env:
14+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
15+
1316
jobs:
1417
ci:
1518
name: Report memory usage
1619
runs-on: ubuntu-latest
1720
steps:
18-
- name: Checkout main
19-
uses: actions/checkout@v3
20-
with:
21-
submodules: recursive
22-
ref: main
23-
- name: Baseline report
24-
run: |
25-
make test
26-
mkdir artifacts
27-
# TODO: main does not generate the .size files yet:
28-
#cat build/test/*.size > artifacts/baseline-report.txt
29-
- name: Checkout update
30-
uses: actions/checkout@v3
21+
- name: Generate memory usage report (current branch)
22+
uses: ./.github/actions/memory-report.yml
3123
with:
32-
submodules: recursive
33-
- name: Update report
34-
run: |
35-
make test
36-
cat build/test/*.size > artifacts/update-report.txt
37-
cp artifacts/update-report.txt artifacts/baseline-report.txt
38-
# TODO: remove cp
39-
- name: Combine
40-
run:
41-
python3 parse-reports.py artifacts/baseline-report.txt artifacts/update-report.txt artifacts/report.txt
42-
- name: Comment
43-
uses: gavv/pull-request-artifacts@v2.1.0
24+
branch: ${GITHUB_REF##*/}
25+
- name: Generate memory usage report (main)
26+
uses: ./.github/actions/memory-report.yml
4427
with:
45-
commit: ${{ github.event.pull_request.head.sha }}
46-
repo-token: ${{ secrets.GITHUB_TOKEN }}
47-
artifacts: artifacts/report.txt
48-
comment-title: "Memory usage report"
49-
comment-message: "Here is an overview of how your pull request impacts the memory usage compared to the main branch:"
28+
branch: main
29+
30+
# - name: Checkout main
31+
# uses: actions/checkout@v3
32+
# with:
33+
# submodules: recursive
34+
# ref: main
35+
# - name: Baseline report
36+
# run: |
37+
# make test
38+
# mkdir artifacts
39+
# # TODO: main does not generate the .size files yet:
40+
# #cat build/test/*.size > artifacts/baseline-report.txt
41+
# - name: Checkout update
42+
# uses: actions/checkout@v3
43+
# with:
44+
# submodules: recursive
45+
# - name: Update report
46+
# run: |
47+
# make test
48+
# cat build/test/*.size > artifacts/update-report.txt
49+
# cp artifacts/update-report.txt artifacts/baseline-report.txt
50+
# # TODO: remove cp
51+
# - name: Combine
52+
# run:
53+
# python3 parse-reports.py artifacts/baseline-report.txt artifacts/update-report.txt artifacts/report.txt
54+
# - name: Comment
55+
# uses: gavv/pull-request-artifacts@v2.1.0
56+
# with:
57+
# commit: ${{ github.event.pull_request.head.sha }}
58+
# repo-token: ${{ secrets.GITHUB_TOKEN }}
59+
# artifacts: artifacts/report.txt
60+
# comment-title: "Memory usage report"
61+
# comment-message: "Here is an overview of how your pull request impacts the memory usage compared to the main branch:"

0 commit comments

Comments
 (0)