Skip to content

Commit

Permalink
Merge pull request #63 from rst0git/check-size-error-msg
Browse files Browse the repository at this point in the history
test/check-size: show error if make fails
  • Loading branch information
adrianreber committed Jun 9, 2023
2 parents fa6a6f2 + 18d6c79 commit 0405c79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
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
# 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

0 comments on commit 0405c79

Please sign in to comment.