Skip to content

Commit

Permalink
ci: migrate to Ubuntu 24.04
Browse files Browse the repository at this point in the history
Move to Ubuntu 24.04 and drop the workarounds that were needed to run
the tests on 22.04.
  • Loading branch information
daniloegea authored and slyon committed Aug 14, 2024
1 parent 5b71d25 commit 63370f5
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 43 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/autopkgtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
lxd-ubuntu-jammy:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -34,37 +34,24 @@ jobs:
- name: Install dependencies
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci
sudo apt update
sudo apt install autopkgtest ubuntu-dev-tools devscripts openvswitch-switch linux-modules-extra-$(uname -r)
# work around LP: #1878225 as fallback
- name: Preparing autopkgtest-build-lxd
run: |
sudo patch /usr/bin/autopkgtest-build-lxd .github/workflows/snapd.patch
autopkgtest-build-lxd ubuntu-daily:jammy
autopkgtest-build-lxd ubuntu-daily:noble
- name: Prepare test
run: |
pull-lp-source netplan.io
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
# usrmerge-fix
echo "" >> debian/rules
echo "execute_after_dh_auto_install:" >> debian/rules
echo " sh -c \"mkdir -p debian/tmp/usr/lib/systemd/system-generators; rm -rf debian/tmp/lib; ln -sf /usr/libexec/netplan/generate debian/tmp/usr/lib/systemd/system-generators/netplan\"" >> debian/rules
# usrmerge-fix-end
sed -i 's| systemd-dev|# DELETED: systemd-dev|' debian/control
sed -i 's| python3-gi,| python3-gi, python3-packaging,|' debian/tests/control # needed for the 'routing' test (nm_version)
TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) # find latest (stable) tag
REV=$(git rev-parse --short HEAD) # get current git revision
VER="$TAG+git~$REV"
dch -v "$VER" "Autopkgtest CI testing (Jammy)"
dch -v "$VER" "Autopkgtest CI testing (Noble)"
- name: Run autopkgtest (incl. build)
run: |
# using --setup-commands temporarily to install:
# cmocka/pytest/rich/ethtool until they become proper test-deps
# The netplan-ci PPA is used here temporally to fix some quirks:
# - A bug with veths and network-manager 1.36. See LP: #2032824
# - A bug with gre6/vti6 and systemd-networkd 249.11. See LP: #2037667
autopkgtest . \
--setup-commands='sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci' \
-U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/jammy/amd64
-U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/noble/amd64
4 changes: 1 addition & 3 deletions .github/workflows/build-abi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -29,11 +29,9 @@ jobs:
- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci
sudo apt update
sudo apt install abigail-tools ubuntu-dev-tools devscripts equivs
pull-lp-source netplan.io
sed -i 's| systemd-dev|# DELETED: systemd-dev|' netplan.io-*/debian/control
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
# Runs the build
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/check-address-sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ on:

jobs:
memory-sanitizer:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3

- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci
sudo apt update
sudo apt -y install curl expect ubuntu-dev-tools devscripts equivs
pull-lp-source netplan.io
sed -i 's| systemd-dev|# DELETED: systemd-dev|' netplan.io-*/debian/control
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
- name: Run unit tests
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# This workflow contains a single job called "test-and-coverage"
test-and-coverage:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -26,15 +26,11 @@ jobs:
- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci
sudo apt update
sudo apt install curl expect ubuntu-dev-tools devscripts equivs gcovr
pull-lp-source netplan.io
sed -i 's| systemd-dev|# DELETED: systemd-dev|' netplan.io-*/debian/control
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
rm -rf netplan.io-*/
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcovr/gcovr_5.2-1_all.deb
sudo dpkg -i gcovr*.deb # we need newer gcovr to make the gcovr.cfg:exclude setting work
# Runs the unit tests with coverage
- name: Run unit tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-wording.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
# Installs the build dependencies
- name: Install build depends
run: |
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo sed -i 's/Types: deb/Types: deb deb-src/g' /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
sudo apt install meson python3-coverage python3-pytest python3-pytest-cov libcmocka-dev python3-cffi libpython3-dev
sudo apt build-dep netplan.io
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/config-fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,18 @@ on:

jobs:
config-fuzzer:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3

- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
# This PPA is needed here due to meson
sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci
sudo apt update
sudo apt -y install curl expect ubuntu-dev-tools devscripts equivs
sudo snap install node --classic
pull-lp-source netplan.io
sed -i 's| systemd-dev|# DELETED: systemd-dev|' netplan.io-*/debian/control
# Workaround for https://bugs.launchpad.net/bugs/2048768
sudo sysctl vm.mmap_rnd_bits=28
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ on:
jobs:
coverity:
if: github.repository == 'canonical/netplan'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo add-apt-repository -y -u -s ppa:slyon/netplan-ci
sudo apt update
sudo apt -y install curl ubuntu-dev-tools equivs
pull-lp-source netplan.io
sed -i 's| systemd-dev|# DELETED: systemd-dev|' netplan.io-*/debian/control
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
- name: Download Coverity
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/network-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
lxd-network-manager:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -40,9 +40,6 @@ jobs:
pull-lp-source netplan.io
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
# usrmerge-fix
sed -i 's|rm debian/tmp/lib/netplan/generate|sh -c "mkdir -p debian/tmp/usr/lib/systemd/system-generators; rm -rf debian/tmp/lib; ln -sf /usr/libexec/netplan/generate debian/tmp/usr/lib/systemd/system-generators/netplan"|' debian/rules
# usrmerge-fix-end
echo "3.0 (native)" > debian/source/format # force native build
TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) # find latest (stable) tag
REV=$(git rev-parse --short HEAD) # get current git revision
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
spread:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: canonical/[email protected]
- uses: actions/checkout@v3
Expand Down

0 comments on commit 63370f5

Please sign in to comment.