]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ci: add build job on Ubuntu Jammy with Python 3.7 38500/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 6 Aug 2025 11:42:35 +0000 (12:42 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 6 Aug 2025 13:09:33 +0000 (14:09 +0100)
In order to avoid regressions with glibc < 2.39 and Python 3.7

.github/workflows/build-test.sh
.github/workflows/build-test.yml

index 4693382c201696a81e015c9f7bfb8b48ec595c6b..c683ca2de2f21ea69d9cfb3638f10517e430ebf4 100755 (executable)
@@ -124,10 +124,15 @@ fi
 
 # This is added by default, and it is often broken, but we don't need anything from it
 sudo rm -f /etc/apt/sources.list.d/microsoft-prod.{list,sources}
-# add-apt-repository --enable-source does not work on deb822 style sources.
-for f in /etc/apt/sources.list.d/*.sources; do
-    sudo sed -i "s/Types: deb/Types: deb deb-src/g" "$f"
-done
+if grep -q 'VERSION_CODENAME=jammy' /usr/lib/os-release; then
+    sudo add-apt-repository -y --no-update ppa:upstream-systemd-ci/systemd-ci
+    sudo add-apt-repository -y --no-update --enable-source
+else
+    # add-apt-repository --enable-source does not work on deb822 style sources.
+    for f in /etc/apt/sources.list.d/*.sources; do
+        sudo sed -i "s/Types: deb/Types: deb deb-src/g" "$f"
+    done
+fi
 sudo apt-get -y update
 sudo apt-get -y build-dep systemd
 sudo apt-get -y install "${PACKAGES[@]}"
@@ -138,6 +143,11 @@ sudo apt-get -y install "${PACKAGES[@]}"
 pip3 install --user -r .github/workflows/requirements.txt --require-hashes --break-system-packages
 export PATH="$HOME/.local/bin:$PATH"
 
+if [[ -n "$CUSTOM_PYTHON" ]]; then
+    # If CUSTOM_PYTHON is set we need to pull jinja2 from pip, as a local interpreter is used
+    pip3 install --user --break-system-packages jinja2
+fi
+
 $CC --version
 meson --version
 ninja --version
index 1232773e3ae937f526165166cf0535d9da9ca640..9e76c7920fb07f619c133c29340157d40767f48c 100644 (file)
@@ -19,12 +19,13 @@ jobs:
   build:
     runs-on: ${{ matrix.runner }}
     concurrency:
-      group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}-${{ matrix.runner }}
+      group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}-${{ matrix.runner }}-${{ matrix.python-version }}
       cancel-in-progress: true
     strategy:
       fail-fast: false
       matrix:
         runner: [ ubuntu-24.04 ]
+        python-version: [ '' ]
         env:
           - { COMPILER: "gcc",   COMPILER_VERSION: "11", LINKER: "bfd"  }
           - { COMPILER: "gcc",   COMPILER_VERSION: "13", LINKER: "mold" }
@@ -34,13 +35,26 @@ jobs:
         include:
           - env: { COMPILER: "gcc",   COMPILER_VERSION: "11", LINKER: "bfd"  }
             runner: [ ubuntu-24.04-ppc64le ]
+            python-version: ''
           - env: { COMPILER: "gcc",   COMPILER_VERSION: "13", LINKER: "mold"  }
             runner: [ ubuntu-24.04-arm ]
+            python-version: ''
           - env: { COMPILER: "clang", COMPILER_VERSION: "18", LINKER: "lld"  }
             runner: [ ubuntu-24.04-s390x ]
+            python-version: ''
+          # Do one run with the oldest supported python version to ensure there are no regressions
+          # It is only available on Jammy, which is useful as it will also provide a build check for
+          # older glibc
+          - env: { COMPILER: "gcc",   COMPILER_VERSION: "12", LINKER: "bfd", CUSTOM_PYTHON: "1"  }
+            runner: [ ubuntu-22.04 ]
+            python-version: '3.7'
     env: ${{ matrix.env }}
     steps:
       - name: Repository checkout
         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+      - name: Setup python
+        uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
+        with:
+          python-version: ${{ matrix.python-version }}
       - name: Build check
         run: .github/workflows/build-test.sh