ci: sdk binary size report #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SDK Binary Size Comparison | |
# only run on PRs and when push a commit on a branch that we don't deploy on. | |
on: [push, pull_request] | |
jobs: | |
sdk-binary-size-comparison-report: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-android | |
- name: Checkout base branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Generate report for base branch | |
run: ./gradlew generateSdkSizeReport -PsaveReportTo=build/base-branch | |
- name: Checkout to PR branch | |
uses: actions/checkout@v4 | |
- name: Generate report for PR branch | |
run: ./gradlew generateSdkSizeReport # Uses default $buildDir to save the report | |
- name: Compare SDK Size Reports | |
run: ./gradlew compareSdkSizeReports -PcompareWithDir=build/base-branch | |
- name: Find old comment to update comment for | |
uses: peter-evans/find-comment@v3 | |
id: find-previous-comment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: SDK Binary Size Comparison | |
- name: Add or Update PR Comment with SDK Size Comparison Report | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
comment-id: ${{ steps.find-previous-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
## 📏 SDK Binary Size Comparison Report\n\n | |
$(cat ${{ github.workspace }}/build/sdk-binary-comparison.md) | |
edit-mode: replace |