Skip to content

Commit ef891c3

Browse files
authored
Merge pull request #45 from tweedegolf/Better-size-print
Print better size
2 parents cfdb2c6 + 49dc716 commit ef891c3

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ jobs:
5454
pull-requests: write
5555
steps:
5656
- 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'
6457
- uses: actions/cache@v3
6558
id: cache-cargo
6659
with:
@@ -71,9 +64,23 @@ jobs:
7164
~/.cargo/git/db/
7265
./example/target/
7366
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'
7477
- name: Build new binary
7578
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
7784
- name: Save binary
7885
run: |
7986
mv ./example/target/thumbv7em-none-eabihf/release/example ./example/target/thumbv7em-none-eabihf/release/original.elf
@@ -94,12 +101,12 @@ jobs:
94101
- name: Add a PR comment with the bloaty diff
95102
if: ${{ github.event.pull_request }}
96103
continue-on-error: true
97-
uses: actions/github-script@v6
104+
uses: actions/github-script@v7
98105
with:
99106
script: |
100107
github.rest.issues.createComment({
101108
issue_number: context.issue.number,
102109
owner: context.repo.owner,
103110
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`
105112
})

0 commit comments

Comments
 (0)