Skip to content

Commit

Permalink
Workflow: Python - Test Debian-testing (Sid)
Browse files Browse the repository at this point in the history
This is to match whats in ./Dockerfiles_*

There is a lot of duplicate lines/code ("Don't repeat yourself" DRY).
This is because that GitHub actions doesn't support YAML Anchors.
When they do, re-work this section!
actions/runner#1182
  • Loading branch information
g0tmi1k committed Feb 12, 2025
1 parent 52c0b38 commit 4187b96
Showing 1 changed file with 111 additions and 58 deletions.
169 changes: 111 additions & 58 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,75 @@
---
name: Check, build and test Python package

env:
# Enable forward compatibility with newer versions of Python
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"

"on":
push:
pull_request:
schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build

env:
# Enable forward compatibility with newer versions of Python
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"

# Matches default: ./Dockerfile_*
# Dirty hack for the lack of YAML anchors
CORE_DEB: |
ca-certificates
cargo
gcc
git
libclang-dev
libgpgme-dev
libpython3-dev
libssl-dev
libtdb-dev
make
mypy-protobuf
pkg-config
protobuf-compiler
python3-gpg
python3-pip
python3-setuptools
python3-setuptools-rust
python3-wheel
python3-wheel-whl
rustc
swig
# Matches extra packages: ./Dockerfile_*
# Dirty hack for the lack of YAML anchors
EXTRA_DEB: |
apt-file
autoconf
autopkgtest
debootstrap
devscripts
diffoscope
dpkg
dpkg-dev
g++
git-buildpackage
gnome-pkg-tools
gnupg
libapt-pkg-dev
libjs-chart.js
libjs-jquery
libjs-jquery-datatables
libjs-jquery-typeahead
libjs-moment
libjs-sphinxdoc
lintian
mypy-protobuf
openssh-client
perl-doc
pristine-tar
python3
python3-breezy
python3-setuptools-protobuf
quilt
sbuild
ssh
subversion
jobs:
checks:
name: Checks
Expand Down Expand Up @@ -85,62 +144,10 @@ jobs:
run: |
set -x
sudo apt-get update --yes
# Matches default: ./Dockerfile_*
sudo apt-get satisfy --yes --no-install-recommends \
ca-certificates
cargo
gcc
git
libclang-dev
libgpgme-dev
libpython3-dev
libssl-dev
libtdb-dev
make
mypy-protobuf
pkg-config
protobuf-compiler
python3-gpg
python3-pip
python3-setuptools
python3-setuptools-rust
python3-wheel
python3-wheel-whl
rustc
swig
# Matches extra packages: ./Dockerfile_*
${CORE_DEB}
sudo apt-get satisfy --yes --no-install-recommends \
apt-file
autoconf
autopkgtest
debootstrap
devscripts
diffoscope
dpkg
dpkg-dev
g++
git-buildpackage
gnome-pkg-tools
gnupg
libapt-pkg-dev
libjs-chart.js
libjs-jquery
libjs-jquery-datatables
libjs-jquery-typeahead
libjs-moment
libjs-sphinxdoc
lintian
mypy-protobuf
openssh-client
perl-doc
pristine-tar
python3
python3-breezy
python3-setuptools-protobuf
quilt
sbuild
ssh
subversion
${EXTRA_DEB}
- name: Install dependencies (rust)
run: |
set -x
Expand Down Expand Up @@ -183,3 +190,49 @@ jobs:
make test PYTHON=python3
env:
PYTHONHASHSEED: random

build-container:
name: Debian-testing
runs-on: ubuntu-latest
container:
# This is to match: ./Dockerfile_*
# https://hub.docker.com/_/debian
image: docker.io/debian:testing-slim

# There is a lot here that is duplicated here (build-container) and above (build)
# Can be made 'better' when GitLab actions support YAML anchors
# https://github.com/actions/runner/issues/1182
# Using system environments as a temp/dirty hack
# Steps to perform in job
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies (apt)
run: |
set -x
apt-get update --yes
apt-get satisfy --yes --no-install-recommends \
${CORE_DEB}
apt-get satisfy --yes --no-install-recommends \
${EXTRA_DEB}
- name: Install dependencies (rust)
run: |
set -x
git clone https://github.com/jelmer/ognibuild.git /build/ognibuild/
cd /build/ognibuild/
cargo build --verbose
- name: PIP install & setup
run: |
set -x
pip3 install --break-system-packages --upgrade --editable \
.[dev,debian]
python3 setup.py develop
python3 setup.py build_ext -i
- name: Make
run: |
set -x
make PYTHON=python3
- name: Make all
run: |
set -x
make all PYTHON=python3

0 comments on commit 4187b96

Please sign in to comment.