File tree Expand file tree Collapse file tree 1 file changed +16
-24
lines changed Expand file tree Collapse file tree 1 file changed +16
-24
lines changed Original file line number Diff line number Diff line change 9
9
test :
10
10
name : Check binary size
11
11
runs-on : ubuntu-latest
12
+ permissions :
13
+ pull-requests : write
12
14
steps :
13
15
- name : Print info
14
16
run : |
15
17
echo "Current SHA: ${{ github.sha }}"
16
18
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
+ })
You can’t perform that action at this time.
0 commit comments