54
54
pull-requests : write
55
55
steps :
56
56
- uses : dtolnay/rust-toolchain@nightly
57
- - run : rustup target add thumbv7em-none-eabihf
58
- - run : rustup component add rust-src
59
-
60
- - name : Check out the repo with the full git history
61
- uses : actions/checkout@v3
62
- with :
63
- fetch-depth : ' 0'
64
57
- uses : actions/cache@v3
65
58
id : cache-cargo
66
59
with :
71
64
~/.cargo/git/db/
72
65
./example/target/
73
66
key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
67
+
68
+ - run : rustup target add thumbv7em-none-eabihf
69
+ - run : rustup component add rust-src llvm-tools
70
+ - if : steps.cache-cargo.outputs.cache-hit != 'true'
71
+ run : cargo install cargo-binutils
72
+
73
+ - name : Check out the repo with the full git history
74
+ uses : actions/checkout@v3
75
+ with :
76
+ fetch-depth : ' 0'
74
77
- name : Build new binary
75
78
working-directory : ./example
76
- run : cargo build --release
79
+ run : |
80
+ echo 'RESULT<<EOF' >> $GITHUB_OUTPUT
81
+ cargo size --release >> $GITHUB_OUTPUT
82
+ echo 'EOF' >> $GITHUB_OUTPUT
83
+ id : new-size
77
84
- name : Save binary
78
85
run : |
79
86
mv ./example/target/thumbv7em-none-eabihf/release/example ./example/target/thumbv7em-none-eabihf/release/original.elf
@@ -94,12 +101,12 @@ jobs:
94
101
- name : Add a PR comment with the bloaty diff
95
102
if : ${{ github.event.pull_request }}
96
103
continue-on-error : true
97
- uses : actions/github-script@v6
104
+ uses : actions/github-script@v7
98
105
with :
99
106
script : |
100
107
github.rest.issues.createComment({
101
108
issue_number: context.issue.number,
102
109
owner: context.repo.owner,
103
110
repo: context.repo.repo,
104
- body: ' ## PR build size diff\n`` `\n${{ steps.bloaty-comparison.outputs.bloaty-output-encoded }}`` `\n'
111
+ body: ` ## PR build size\n \`\`\`\n${{ join(steps.new-size.outputs.*, '\n') }}\n\`\`\ `\n ### Diff\n\`\`\`\n ${{ steps.bloaty-comparison.outputs.bloaty-output-encoded }}\`\`\ `\n`
105
112
})
0 commit comments