| 1 |
name: Check binary size |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review] |
| 6 |
|
| 7 |
jobs: |
| 8 |
check_size: |
| 9 |
runs-on: ubuntu-latest |
| 10 |
# Check if pull request does not have label "bloat-ok". |
| 11 |
if: "!contains(github.event.pull_request.labels.*.name, 'bloat-ok')" |
| 12 |
steps: |
| 13 |
- uses: actions/checkout@v4 |
| 14 |
with: |
| 15 |
# Needed to rebase against the base branch |
| 16 |
fetch-depth: 0 |
| 17 |
# Checkout pull request HEAD commit instead of merge commit |
| 18 |
ref: ${{ github.event.pull_request.head.sha }} |
| 19 |
- name: Configure git user details |
| 20 |
run: | |
| 21 |
git config --global user.email "[email protected]" |
| 22 |
git config --global user.name "checkpoint-restore" |
| 23 |
- name: Configure base branch without switching current branch |
| 24 |
run: git fetch origin ${GITHUB_BASE_REF}:${GITHUB_BASE_REF} |
| 25 |
- name: Compare binary size change across each commit |
| 26 |
# Use the last non-merge commit from the base branch as the baseline |
| 27 |
run: git rebase -v $(git rev-list --no-merges -n 1 ${GITHUB_BASE_REF})^ -x test/check-size.sh |