Skip to content

Commit

Permalink
ci: add upstream post-merge test
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed Feb 6, 2025
1 parent 4800b2d commit 1f58b55
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/packaging-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ jobs:
fi
# The quilt default setting is --fuzz=2, but debian packaging has
# stricter requirements
cp /etc/quilt.quiltrc ~/.quiltrc
sed -i 's/QUILT_PUSH_ARGS=.*$/QUILT_PUSH_ARGS="--fuzz=0"/g'
sudo sed -i 's/QUILT_PUSH_ARGS=.*$/QUILT_PUSH_ARGS="--fuzz=0"/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
- name: Run test - apply patches and run unit tests
run: |
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/packaging-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This test runs after merging PRs into upstream to notify maintainers when
# a new PR has caused a patch to not apply against the merged branch.
name: "Packaging (main branch) - patches apply cleanly and unit tests pass (after merging)"

on:
push:
branches:
- main

concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

defaults:
run:
shell: bash -ex {0}

jobs:
patch-conflicts-ubuntu:
runs-on: ubuntu-24.04
name: Check patches
steps:

- name: Setup - checkout branches
uses: actions/checkout@v4
with:
# Fetch all history for merging
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup - install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install tox quilt
- name: Setup - configure quilt
run: |
# 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
# 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
- name: Setup - configure git
run: |
git config user.name "Github Actions"
git config user.email "noreply@github.com"
- name: Run test - apply patches and run unit tests for each series
run: |
# Modify the following line to add / remove ubuntu series
for BRANCH in ubuntu/devel ubuntu/oracular ubuntu/noble ubuntu/jammy ubuntu/focal; do
# merge - this step is not expected to fail
git merge "origin/$BRANCH"
if [ ! -f debian/patches/series ]; then
echo "no patches, skipping $BRANCH"
# undo merge - this step is not expected to fail
git reset --hard ${{ github.event.pull_request.head.sha }}
continue
fi
# did patches apply cleanly?
quilt push -a
# run unit tests
tox -e py3
# a patch didn't un-apply cleanly if this step fails
quilt pop -a
# undo merge - this step is not expected to fail
git reset --hard ${{ github.event.pull_request.head.sha }}
done

0 comments on commit 1f58b55

Please sign in to comment.