Skip to content

Commit

Permalink
WIP: tests (4/x)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Dec 26, 2023
1 parent e2552e2 commit 4345e2e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 70 deletions.
69 changes: 69 additions & 0 deletions .github/actions/pydpkg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
inputs:
workaround:
default: false
required: true
path:
default: "debian"
required: true

branding:
icon: "rotate-cw"
color: "red"

env:
# note that some tools care only for the name, not the value
FORCE_COLOR: 1

# reduce metadata. unlike elsewhere, build artifacts should differ by content only
SOURCE_DATE_EPOCH: 0

runs:
using: "composite"
steps:
- name: prepare deb source dir (${{ inputs.path }})
# why the incorrect version? because this way we can skip rewrite debian/changelog for now
shell: bash
run: |
mkdir --verbose --parents upload/${{ inputs.path }}
mkdir --verbose --parents ${{ inputs.path }}
( cd source/ && git archive --format=tar --prefix=gunicorn-21.2.0/ HEAD | gzip ) > ${{ inputs.path }}/gunicorn_21.2.0.orig.tar.gz
( cd ${{ inputs.path }}/ && tar --extract --file gunicorn_21.2.0.orig.tar.gz gunicorn-21.2.0 )
test -s ${{ inputs.path }}/gunicorn-21.2.0/pyproject.toml
rsync -vrlt source/.github/packaging/debian/ ${{ inputs.path }}/gunicorn-21.2.0/debian
chmod --changes +x ${{ inputs.path }}/gunicorn-21.2.0/debian/control
ls -l ${{ inputs.path }}/gunicorn-21.2.0/
- name: prepare deb source dir (${{ inputs.path }})
if: ${{ inputs.workaround }}
shell: bash
run: |
echo 'extend-diff-ignore = "^setup\.cfg$"' >> ${{ inputs.path }}/gunicorn-21.2.0/debian/source/options
mv --verbose ${{ inputs.path }}/gunicorn-21.2.0/debian/setup.cfg ${{ inputs.path }}/gunicorn-21.2.0/
# ideally, build-dep step would be executed by dkpg scripts
- name: Install dpkg Dependencies
shell: bash
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install dpkg-dev make python3-all quilt debhelper dh-python python3-setuptools pybuild-plugin-pyproject
# print versions
apt policy python3-all
apt policy dh-python
apt policy python3-setuptools
apt policy python3-distutils
apt policy python3-toml
apt policy python3-tomli
apt policy python3-setuptools-whl
apt policy python3-pep517
apt policy python3-build
apt policy pybuild-plugin-pyproject
- name: build deb (${{ inputs.path }})
shell: bash
run: |
test -s ${{ inputs.path }}/gunicorn-21.2.0/pyproject.toml
test -s ${{ inputs.path }}/gunicorn-21.2.0/setup.cfg
test -s ${{ inputs.path }}/gunicorn-21.2.0/debian/control
test -d ${{ inputs.path }}/gunicorn-21.2.0/tests
( cd ${{ inputs.path }}/gunicorn-21.2.0/ && dpkg-buildpackage --unsigned-source --unsigned-changes )
# note that Ubuntu 22.04 does not allow zstd in dpkg tools
rsync -trv ${{ inputs.path }}/*.{deb,tar.gz,tar.xz,tar.zstd,buildinfo,changes,dsc} upload/${{ inputs.path }}/
83 changes: 13 additions & 70 deletions .github/workflows/buildpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,80 +42,23 @@ jobs:
- uses: actions/checkout@v4
with:
path: source
- name: prepare deb source dir (workaround)
# why the incorrect version? because this way we can skip rewrite debian/changelog for now
run: |
mkdir --verbose --parents upload/workaround
mkdir --verbose --parents workaround
( cd source/ && git archive --format=tar --prefix=gunicorn-21.2.0/ HEAD | gzip ) > workaround/gunicorn_21.2.0.orig.tar.gz
( cd workaround/ && tar --extract --file gunicorn_21.2.0.orig.tar.gz gunicorn-21.2.0 )
test -s workaround/gunicorn-21.2.0/pyproject.toml
rsync -vrlt source/.github/packaging/debian/ workaround/gunicorn-21.2.0/debian
echo 'extend-diff-ignore = "^setup\.cfg$"' >> workaround/gunicorn-21.2.0/debian/source/options
mv --verbose workaround/gunicorn-21.2.0/debian/setup.cfg workaround/gunicorn-21.2.0/
chmod --changes +x workaround/gunicorn-21.2.0/debian/control
ls -l workaround/gunicorn-21.2.0/
- name: prepare deb source dir (clean)
run: |
mkdir --verbose --parents upload
mkdir --verbose --parents debian
( cd source/ && git archive --format=tar --prefix=gunicorn-21.2.0/ HEAD | gzip ) > debian/gunicorn_21.2.0.orig.tar.gz
( cd debian/ && tar --extract --file gunicorn_21.2.0.orig.tar.gz gunicorn-21.2.0 )
test -s debian/gunicorn-21.2.0/pyproject.toml
rsync -vrlt source/.github/packaging/debian/ debian/gunicorn-21.2.0/debian
chmod --changes +x debian/gunicorn-21.2.0/debian/control
ls -l debian/gunicorn-21.2.0/
# ideally, build-dep step would be executed by dkpg scripts
- name: Install dpkg Dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install dpkg-dev make python3-all quilt debhelper dh-python python3-setuptools pybuild-plugin-pyproject
# print versions
apt policy python3-all
apt policy dh-python
apt policy python3-setuptools
apt policy python3-distutils
apt policy python3-toml
apt policy python3-tomli
apt policy python3-setuptools-whl
apt policy python3-pep517
apt policy python3-build
apt policy pybuild-plugin-pyproject
- name: build deb (workaround)
run: |
test -s workaround/gunicorn-21.2.0/pyproject.toml
test -s workaround/gunicorn-21.2.0/setup.cfg
test -s workaround/gunicorn-21.2.0/debian/control
test -d workaround/gunicorn-21.2.0/tests
( cd workaround/gunicorn-21.2.0/ && dpkg-buildpackage --unsigned-source --unsigned-changes )
# note that Ubuntu 22.04 does not allow zstd in dpkg tools
cp --verbose --archive workaround/*.{deb,tar.gz,tar.xz,tar.zstd,buildinfo,changes,dsc} upload/workaround/
- name: build deb (clean)
- uses: ./.github/actions/pydpkg
with:
path: workaround
- uses: ./.github/actions/pydpkg
with:
path: debian-workaround
workaround: true
- uses: ./.github/actions/pydpkg
continue-on-error: true
run: |
test -s debian/gunicorn-21.2.0/pyproject.toml
test -s debian/gunicorn-21.2.0/debian/control
test -d debian/gunicorn-21.2.0/tests
( cd debian/gunicorn-21.2.0/ && dpkg-buildpackage --unsigned-source --unsigned-changes )
# note that Ubuntu 22.04 does not allow zstd in dpkg tools
cp --verbose --archive debian/*.{deb,tar.gz,tar.xz,tar.zstd,buildinfo,changes,dsc} upload/
with:
folder: debian-clean
workaround: false
- uses: actions/upload-artifact@v4
with:
path: |
upload/workaround/*.deb
upload/workaround/*.tar.gz
upload/workaround/*.tar.xz
upload/workaround/*.tar.zstd
upload/workaround/*.buildinfo
upload/workaround/*.changes
upload/workaround/*.dsc
upload/*.deb
upload/*.tar.gz
upload/*.tar.xz
upload/*.tar.zstd
upload/*.buildinfo
upload/*.changes
upload/*.dsc
upload/debian-workaround/*
upload/debian-clean/*
name: deb
retention-days: 5
# deb and source tarball are already compressed
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ jobs:
python -m pip install tox
- run: tox -e run-module
timeout-minutes: 2
continue-on-error: ${{ matrix.unsupported }}
- run: tox -e run-entrypoint
timeout-minutes: 2
continue-on-error: ${{ matrix.unsupported }}
- run: tox -e py
timeout-minutes: 5
continue-on-error: ${{ matrix.unsupported }}
Expand Down

0 comments on commit 4345e2e

Please sign in to comment.