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

ci: check for sorted patches #6036

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/packaging-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
# The quilt default setting is --fuzz=2, but debian packaging has
# stricter requirements
sudo sed -i 's/QUILT_PUSH_ARGS=.*$/QUILT_PUSH_ARGS="--fuzz=0"/g' /etc/quilt.quiltrc
# Standardize patches to use this format. Sorted patches reduce patch size.
sudo sed -i 's/QUILT_REFRESH_ARGS=.*$/QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort"/g' /etc/quilt.quiltrc
# quilt defaults to QUILT_PATCHES=patches, but debian uses debian/patches
sudo sed -i 's|.*QUILT_PATCHES=.*$|QUILT_PATCHES=debian/patches|g' /etc/quilt.quiltrc

Expand All @@ -63,4 +65,17 @@ jobs:
fi
quilt push -a
tox -e py3
quilt pop -a
quilt pop -a --refresh
- name: Enforce sorted patches
run: |
# Github Actions doesn't appear to have a simple mechanism for
# early exit without failure
if [ ! -f debian/patches/series ]; then
echo "no patches, skipping"
exit 0
fi
# check for any changes from the refresh above
if [ -n "$(git diff)" ]; then
# if patches were refreshed then they weren't sorted
exit 1
fi