1414 run : |
1515 set -xeuo pipefail
1616 sudo df -h
17- unwanted_pkgs=('^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*'
17+ # Use globs for package patterns (apt and dpkg both support fnmatch globs)
18+ unwanted_pkgs=('aspnetcore-*' 'dotnet-*' 'llvm-*' 'php*' 'mongodb-*' 'mysql-*'
1819 azure-cli google-chrome-stable firefox mono-devel)
1920 unwanted_dirs=(/usr/share/dotnet /opt/ghc /usr/local/lib/android /opt/hostedtoolcache/CodeQL)
2021 # Start background removal operations as systemd units; if this causes
3031 for x in ${unwanted_dirs[@]}; do
3132 runcleanup rm -rf "$x"
3233 done
33- # Apt removals in foreground, as we can't parallelize these
34+ # Apt removals in foreground, as we can't parallelize these.
35+ # Only attempt removal if matching packages are installed.
3436 for x in ${unwanted_pkgs[@]}; do
35- /bin/time -f '%E %C' sudo apt-get remove -y $x
37+ if dpkg -l "$x" >/dev/null 2>&1; then
38+ /bin/time -f '%E %C' sudo apt-get remove -y "$x"
39+ fi
3640 done
3741 # We really want support for heredocs
3842 - name : Update podman and install just
4347 IDV=$(. /usr/lib/os-release && echo ${ID}-${VERSION_ID})
4448 test "${IDV}" = "ubuntu-24.04"
4549 # plucky is the next release
46- echo 'deb http://azure.archive.ubuntu.com/ubuntu plucky universe main' | sudo tee /etc/apt/sources.list.d/plucky.list
50+ # Ubuntu uses different mirrors for different architectures:
51+ # - amd64: azure.archive.ubuntu.com/ubuntu (on Azure runners)
52+ # - arm64: ports.ubuntu.com/ubuntu-ports
53+ case "$(arch)" in
54+ x86_64)
55+ mirror="http://azure.archive.ubuntu.com/ubuntu"
56+ ;;
57+ aarch64)
58+ mirror="http://ports.ubuntu.com/ubuntu-ports"
59+ ;;
60+ *)
61+ echo "Unsupported architecture: $(arch)" >&2
62+ exit 1
63+ ;;
64+ esac
65+ echo "deb ${mirror} plucky universe main" | sudo tee /etc/apt/sources.list.d/plucky.list
4766 /bin/time -f '%E %C' sudo apt update
4867 # skopeo is currently older in plucky for some reason hence --allow-downgrades
4968 /bin/time -f '%E %C' sudo apt install -y --allow-downgrades crun/plucky podman/plucky skopeo/plucky just
@@ -54,31 +73,27 @@ runs:
5473 set -xeuo pipefail
5574 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
5675 sudo udevadm control --reload-rules
57- sudo udevadm trigger --name-match=kvm
58- ls -l /dev/kvm
76+ # Only trigger if /dev/kvm exists (may not be available on arm64 runners)
77+ if [ -e /dev/kvm ]; then
78+ sudo udevadm trigger --name-match=kvm
79+ ls -l /dev/kvm
80+ else
81+ echo "Note: /dev/kvm not available on this runner"
82+ fi
5983 # Used by a few workflows, but generally useful
6084 - name : Set architecture variable
6185 id : set_arch
6286 shell : bash
6387 run : echo "ARCH=$(arch)" >> $GITHUB_ENV
64- # We often use Rust, so set up opinionated default caching
65- - name : Setup Rust cache
66- uses : Swatinem/rust-cache@v2
67- with :
68- cache-all-crates : true
69- # Only generate caches on push to git main
70- save-if : ${{ github.ref == 'refs/heads/main' }}
71- # Suppress actually using the cache for builds running from
72- # git main so that we avoid incremental compilation bugs
73- lookup-only : ${{ github.ref == 'refs/heads/main' }}
7488 # Install libvirt stack if requested
7589 - name : Install libvirt and virtualization stack
7690 if : ${{ inputs.libvirt == 'true' }}
7791 shell : bash
7892 run : |
7993 set -xeuo pipefail
80- export BCVK_VERSION=0.6.0
81- /bin/time -f '%E %C' sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm virtiofsd libvirt-daemon-system
94+ export BCVK_VERSION=0.10.0
95+ # see https://github.com/bootc-dev/bcvk/issues/176
96+ /bin/time -f '%E %C' sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm virtiofsd libvirt-daemon-system python3-virt-firmware
8297 # Something in the stack is overriding this, but we want session right now for bcvk
8398 echo LIBVIRT_DEFAULT_URI=qemu:///session >> $GITHUB_ENV
8499 td=$(mktemp -d)
0 commit comments