-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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: Generate report for base branch | ||
run: | | ||
git checkout ${{ github.base_ref }} | ||
./gradlew generateSdkSizeReport -PsaveReportTo=build/base-branch | ||
git checkout - | ||
- 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: Add or Update PR Comment with SDK Size Change Summary | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
## SDK Size Comparison Report | ||
$(cat ${{ github.workspace }}/build/sdk-binary-comparison.md) | ||
recreate: true # Recreates the comment to replace the content completely |