Skip to content

Commit 14640a8

Browse files
committed
WIP
1 parent 916846c commit 14640a8

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

.github/workflows/check-binary-size.yml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,24 @@ jobs:
99
test:
1010
name: Check binary size
1111
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
1214
steps:
1315
- name: Print info
1416
run: |
1517
echo "Current SHA: ${{ github.sha }}"
1618
echo "Base SHA: ${{ github.event.pull_request.base.sha }}"
17-
- name: Clone Rustc
18-
run: git clone https://github.com/rust-lang/rust --depth=1
19-
- name: Create hello world crate
20-
run: cargo new --bin /tmp/crate
21-
- name: Build reference binary
22-
run: |
23-
cd rust
24-
cp src/bootstrap/defaults/config.library.toml config.toml
25-
cd library/backtrace
26-
git fetch
27-
git checkout ${{ github.event.pull_request.base.sha }}
28-
cd ../..
29-
python3 x.py build library --stage 0
30-
./build/x86_64-unknown-linux-gnu/stage0/bin/rustc -O /tmp/crate/src/main.rs -o binary-reference
31-
- name: Build current binary
32-
run: |
33-
cd library/backtrace
34-
git checkout ${{ github.sha }}
35-
cd ../..
36-
python3 x.py build library --stage 0
37-
./build/x86_64-unknown-linux-gnu/stage0/bin/rustc -O /tmp/crate/src/main.rs -o binary-updated
38-
- name: Display binary size
39-
run: |
40-
ls -lha binary-*
19+
- uses: actions/github-script@v6
20+
env:
21+
SIZE_REFERENCE: 1
22+
SIZE_UPDATED: 10
23+
with:
24+
script: |
25+
github.rest.issues.createComment({
26+
issue_number: context.issue.number,
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
body: `Original binary size: ${process.env.SIZE_REFERENCE}
30+
Updated binary size: ${process.env.SIZE_UPDATED}
31+
`
32+
})

0 commit comments

Comments
 (0)