]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
CI: Upgrade Ubuntu runners from v22.04 to v24.04 (#2064)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 14 May 2025 14:28:51 +0000 (14:28 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 18 May 2025 02:31:45 +0000 (02:31 +0000)
* Ubuntu 24.04 uses different apt sources file location and format.

* Some Ubuntu 24.04 GitHub Actions runners lack libltdl-dev as detailed
  at https://github.com/actions/runner-images/issues/11316.
  We could explicitly install libltdl-dev for functionality tests, but
  decided to go one step further and unify all prerequisites
  installation steps for tests that build Squid on Ubuntu.

Also added a hack to fix /etc/hosts broken on some Ubuntu runners and
resulting in Squid startup errors during functionality tests:

    kid1| ERROR: ipcacheAddEntryFromHosts: Bad IP address '-e'

.github/workflows/coverity-scan.yaml
.github/workflows/quick.yaml
.github/workflows/slow.yaml

index 5bc4f9a656d1ad52eab8a561ef9c77b2995c7f66..7515d1232c7897849cefca712b077945f55728c3 100644 (file)
@@ -17,7 +17,7 @@ jobs:
     # only run the workflow on Squid's main repository
     if: github.repository == 'squid-cache/squid'
 
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
 
     # this job relies on GitHub repository secrets containing
     # username and password to access the Coverity Scan service
index 1763bb7c65a7f9e69a8854efb6fb0d50c170241f..bc2e3078e3e229c7376ddff76660831d31d9b05a 100644 (file)
@@ -40,12 +40,23 @@ jobs:
 
   functionality-tests:
 
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
 
     steps:
-      - name: Install prerequisite packages
+      # XXX: A hack to fix Ubuntu runners that were created in April 2025.
+      - name: Fix /etc/hosts
+        run: |
+          cat /etc/hosts
+          cp -p /etc/hosts /tmp/etc-hosts.bak
+          sudo sed --in-place -E 's/^(-e.*)/# \1/' /etc/hosts
+          diff -u /tmp/etc-hosts.bak /etc/hosts || true
+
+      - name: Install prerequisite Linux packages
         run: |
+          # required for "apt-get build-dep" to work
+          sudo sed --in-place -E 's/^(Types: deb)$/\1 deb-src/' /etc/apt/sources.list.d/ubuntu.sources
           sudo apt-get --quiet=2 update
+          sudo apt-get --quiet=2 build-dep squid
           sudo apt-get --quiet=2 install libtool-bin
 
       - name: Setup a nodejs environment
@@ -83,7 +94,7 @@ jobs:
 
   source-maintenance-tests:
 
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
 
     steps:
       - name: Install prerequisite packages
@@ -111,7 +122,7 @@ jobs:
       fail-fast: true
       matrix:
         os:
-          - ubuntu-22.04
+          - ubuntu-24.04
         compiler:
           - { CC: gcc, CXX: g++ }
           - { CC: clang, CXX: clang++ }
@@ -133,7 +144,7 @@ jobs:
       - name: Install prerequisite Linux packages
         run: |
           # required for "apt-get build-dep" to work
-          sudo sed --in-place -E 's/# (deb-src.*updates main)/  \1/g' /etc/apt/sources.list
+          sudo sed --in-place -E 's/^(Types: deb)$/\1 deb-src/' /etc/apt/sources.list.d/ubuntu.sources
           sudo apt-get --quiet=2 update
           sudo apt-get --quiet=2 build-dep squid
           sudo apt-get --quiet=2 install linuxdoc-tools libtool-bin ${{ matrix.compiler.CC }} ccache valgrind
@@ -159,17 +170,17 @@ jobs:
 
   CodeQL-tests:
 
-    runs-on: [ ubuntu-22.04 ]
+    runs-on: [ ubuntu-24.04 ]
 
     permissions:
       security-events: write
 
     steps:
 
-      - name: Install Squid prerequisite Linux packages
+      - name: Install prerequisite Linux packages
         run: |
           # required for "apt-get build-dep" to work
-          sudo sed --in-place -E 's/# (deb-src.*updates main)/  \1/g' /etc/apt/sources.list
+          sudo sed --in-place -E 's/^(Types: deb)$/\1 deb-src/' /etc/apt/sources.list.d/ubuntu.sources
           sudo apt-get --quiet=2 update
           sudo apt-get --quiet=2 build-dep squid
           sudo apt-get --quiet=2 install linuxdoc-tools libtool-bin
index 55c08dee10f817d26a039840861da950efad23f5..583ca7cedf38de1345a172e28a074d95e2929fb5 100644 (file)
@@ -50,7 +50,7 @@ jobs:
           - { name: layer-01-minimal, nick: minimal }
           - { name: layer-02-maximus, nick: maximus }
 
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
     container:
       image: squidcache/buildfarm-${{ matrix.os }}:stable
       options: --user 1001 # uid used by worfklow runner
@@ -145,7 +145,7 @@ jobs:
           - 14.2
           - 13.4
 
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
     name: freebsd(${{ matrix.osversion }})
 
     steps:
@@ -186,7 +186,7 @@ jobs:
           path: btlayer-*.log
 
   openbsd:
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-24.04
 
     steps:
       - name: Checkout Sources