Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/check-size: show error if make fails #63

Merged
merged 3 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/check-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
with:
# Needed to rebase against the base branch
fetch-depth: 0
rst0git marked this conversation as resolved.
Show resolved Hide resolved
# Checkout pull request HEAD commit instead of merge commit
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure git user details
run: |
git config --global user.email "bloatchecker@example.com"
git config --global user.name "Bloat Checker"
git config --global user.email "checkpoint-restore@users.noreply.github.com"
git config --global user.name "checkpoint-restore"
- name: Configure base branch without switching current branch
run: git fetch origin ${GITHUB_BASE_REF}:${GITHUB_BASE_REF}
- name: Compare binary size change across each commit
Expand Down
13 changes: 9 additions & 4 deletions test/check-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# across commits. Meant to be used in CI with
# git rebase <base branch>^ -x check-size.sh

# Fail fast on errors
set -e

BIN_NAME=checkpointctl
PREV_SIZE_FILE=prev_size
# Maximum allowable size difference, in bytes
Expand All @@ -16,7 +13,15 @@ MAX_DIFF=51200
# Build the checkpointctl binary. If the commit is not self-contained,
# the build will fail, in which case there is no point checking for a
# change in the size of the binary.
make
if ! make; then
echo "ERROR: Compilation failed at $(git rev-parse --short HEAD)"
echo "Make sure that the compilation is successful for each commit."
exit 1
fi

# Fail fast on errors
set -e

# Store the binary size
BIN_SIZE=$(stat -c%s "$BIN_NAME")
# Print the size along with the commit hash
Expand Down