Skip to content

Commit

Permalink
[Misc]: Push test 13
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan committed Mar 6, 2024
1 parent f8cc228 commit 5b16ec9
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions .github/workflows/linux-ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,32 +106,54 @@ jobs:
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Upload binary sizes
- uses: actions-rs/toolchain@v1
toolchain: stable
- name: Build binaries
run: |
cargo build --target aarch64-apple-ios --release
working-directory: codegen-v2
- name: Generate release report
run: |
./tools/release-size measure-rust > release-report.json
- name: Upload release report
uses: actions/upload-artifact@v2
with:
name: registry_json
path: registry.json
name: release_report
path: release-report.json

check-binary-sizes:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
toolchain: stable
- name: Build binaries
run: |
cargo build --target aarch64-apple-ios --release
working-directory: codegen-v2
- name: Generate release report
run: |
./tools/release-size measure-rust > release-report.json
- name: Download previous artifact
id: download_prev_artifact
- name: Download previous release report
id: download_prev_report
uses: dawidd6/action-download-artifact@v3
with:
commit: ${{github.event.pull_request.base.sha}}
path: prev
path: previous
if_no_artifact_found: warn
# Same artifact name as at the "Upload release report" step.
name: release_report

- name: Craft Comment Body
if: steps.download_prev_artifact.outputs.found_artifact == 'true'
id: compute_sizes
id: craft_body
run: |
echo "size_before=$( du -k prev/registry_json/registry.json | cut -f1 )" >> $GITHUB_OUTPUT
echo "size_after=$( du -k registry.json | cut -f1 )" >> $GITHUB_OUTPUT
before_report=./previous/release-report.json
after_report=./release-report.json
markdown_diff=$(./tools/release-size compare $before_report $after_report)
echo "markdown_body=$markdown_diff" >> $GITHUB_OUTPUT
- name: Create or Update Comment
uses: edumserrano/find-create-or-update-comment@v2
Expand All @@ -142,9 +164,6 @@ jobs:
comment-author: 'github-actions[bot]'
edit-mode: replace
body: |
**Binary size comparison**:
## Binary size comparison
```diff
- registry.json ${{ steps.compute_sizes.outputs.size_before }}
+ registry.json ${{ steps.compute_sizes.outputs.size_after }}
```
${{ steps.craft_body.outputs.markdown_body }}

0 comments on commit 5b16ec9

Please sign in to comment.