diff --git a/.github/workflows/scripts/qemu-2-start.sh b/.github/workflows/scripts/qemu-2-start.sh index 2ea282232d21..28da6700e541 100755 --- a/.github/workflows/scripts/qemu-2-start.sh +++ b/.github/workflows/scripts/qemu-2-start.sh @@ -1,259 +1,254 @@ #!/usr/bin/env bash ###################################################################### # 2) start qemu with some operating system, init via cloud-init ###################################################################### set -eu # short name used in zfs-qemu.yml OS="$1" # OS variant (virt-install --os-variant list) OSv=$OS # compressed with .zst extension REPO="https://github.com/mcmilk/openzfs-freebsd-images" FREEBSD="$REPO/releases/download/v2025-04-13" URLzs="" # Ubuntu mirrors UBMIRROR="https://cloud-images.ubuntu.com" #UBMIRROR="https://mirrors.cloud.tencent.com/ubuntu-cloud-images" #UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images" # default nic model for vm's NIC="virtio" case "$OS" in almalinux8) OSNAME="AlmaLinux 8" URL="https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2" ;; almalinux9) OSNAME="AlmaLinux 9" URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2" ;; almalinux10) OSNAME="AlmaLinux 10" OSv="almalinux9" URL="https://repo.almalinux.org/almalinux/10/cloud/x86_64/images/AlmaLinux-10-GenericCloud-latest.x86_64.qcow2" ;; archlinux) OSNAME="Archlinux" URL="https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2" ;; centos-stream10) OSNAME="CentOS Stream 10" # TODO: #16903 Overwrite OSv to stream9 for virt-install until it's added to osinfo OSv="centos-stream9" URL="https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-10-latest.x86_64.qcow2" ;; centos-stream9) OSNAME="CentOS Stream 9" URL="https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2" ;; debian11) OSNAME="Debian 11" URL="https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2" ;; debian12) OSNAME="Debian 12" URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2" ;; - fedora40) - OSNAME="Fedora 40" - OSv="fedora-unknown" - URL="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" - ;; fedora41) OSNAME="Fedora 41" OSv="fedora-unknown" URL="https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2" ;; fedora42) OSNAME="Fedora 42" OSv="fedora-unknown" URL="https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2" ;; freebsd13-4r) OSNAME="FreeBSD 13.4-RELEASE" OSv="freebsd13.0" URLzs="$FREEBSD/amd64-freebsd-13.4-RELEASE.qcow2.zst" BASH="/usr/local/bin/bash" NIC="rtl8139" ;; freebsd13-5r) OSNAME="FreeBSD 13.5-RELEASE" OSv="freebsd13.0" URLzs="$FREEBSD/amd64-freebsd-13.5-RELEASE.qcow2.zst" BASH="/usr/local/bin/bash" NIC="rtl8139" ;; freebsd14-1r) OSNAME="FreeBSD 14.1-RELEASE" OSv="freebsd14.0" URLzs="$FREEBSD/amd64-freebsd-14.1-RELEASE.qcow2.zst" BASH="/usr/local/bin/bash" ;; freebsd14-2r) OSNAME="FreeBSD 14.2-RELEASE" OSv="freebsd14.0" URLzs="$FREEBSD/amd64-freebsd-14.2-RELEASE.qcow2.zst" BASH="/usr/local/bin/bash" ;; freebsd13-5s) OSNAME="FreeBSD 13.5-STABLE" OSv="freebsd13.0" URLzs="$FREEBSD/amd64-freebsd-13.5-STABLE.qcow2.zst" BASH="/usr/local/bin/bash" NIC="rtl8139" ;; freebsd14-2s) OSNAME="FreeBSD 14.2-STABLE" OSv="freebsd14.0" URLzs="$FREEBSD/amd64-freebsd-14.2-STABLE.qcow2.zst" BASH="/usr/local/bin/bash" ;; freebsd15-0c) OSNAME="FreeBSD 15.0-CURRENT" OSv="freebsd14.0" URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst" BASH="/usr/local/bin/bash" ;; tumbleweed) OSNAME="openSUSE Tumbleweed" OSv="opensusetumbleweed" MIRROR="http://opensuse-mirror-gce-us.susecloud.net" URL="$MIRROR/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2" ;; ubuntu22) OSNAME="Ubuntu 22.04" OSv="ubuntu22.04" URL="$UBMIRROR/jammy/current/jammy-server-cloudimg-amd64.img" ;; ubuntu24) OSNAME="Ubuntu 24.04" OSv="ubuntu24.04" URL="$UBMIRROR/noble/current/noble-server-cloudimg-amd64.img" ;; *) echo "Wrong value for OS variable!" exit 111 ;; esac # environment file ENV="/var/tmp/env.txt" echo "ENV=$ENV" >> $ENV # result path echo 'RESPATH="/var/tmp/test_results"' >> $ENV # FreeBSD 13 has problems with: e1000 and virtio echo "NIC=$NIC" >> $ENV # freebsd15 -> used in zfs-qemu.yml echo "OS=$OS" >> $ENV # freebsd14.0 -> used for virt-install echo "OSv=\"$OSv\"" >> $ENV # FreeBSD 15 (Current) -> used for summary echo "OSNAME=\"$OSNAME\"" >> $ENV # default vm count for testings VMs=2 echo "VMs=\"$VMs\"" >> $ENV # default cpu count for testing vm's CPU=2 echo "CPU=\"$CPU\"" >> $ENV sudo mkdir -p "/mnt/tests" sudo chown -R $(whoami) /mnt/tests # we are downloading via axel, curl and wget are mostly slower and # require more return value checking IMG="/mnt/tests/cloudimg.qcow2" if [ ! -z "$URLzs" ]; then echo "Loading image $URLzs ..." time axel -q -o "$IMG.zst" "$URLzs" zstd -q -d --rm "$IMG.zst" else echo "Loading image $URL ..." time axel -q -o "$IMG" "$URL" fi DISK="/dev/zvol/zpool/openzfs" FORMAT="raw" sudo zfs create -ps -b 64k -V 80g zpool/openzfs while true; do test -b $DISK && break; sleep 1; done echo "Importing VM image to zvol..." sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M rm -f $IMG PUBKEY=$(cat ~/.ssh/id_ed25519.pub) cat < /tmp/user-data #cloud-config fqdn: $OS users: - name: root shell: $BASH - name: zfs sudo: ALL=(ALL) NOPASSWD:ALL shell: $BASH ssh_authorized_keys: - $PUBKEY growpart: mode: auto devices: ['/'] ignore_growroot_disabled: false EOF sudo virsh net-update default add ip-dhcp-host \ "" --live --config sudo virt-install \ --os-variant $OSv \ --name "openzfs" \ --cpu host-passthrough \ --virt-type=kvm --hvm \ --vcpus=4,sockets=1 \ --memory $((1024*12)) \ --memballoon model=virtio \ --graphics none \ --network bridge=virbr0,model=$NIC,mac='52:54:00:83:79:00' \ --cloud-init user-data=/tmp/user-data \ --disk $DISK,bus=virtio,cache=none,format=$FORMAT,driver.discard=unmap \ --import --noautoconsole >/dev/null # enable KSM on Linux if [ ${OS:0:7} != "freebsd" ]; then sudo virsh dommemstat --domain "openzfs" --period 5 sudo virsh node-memory-tune 100 50 1 echo 1 | sudo tee /sys/kernel/mm/ksm/run > /dev/null fi # Give the VMs hostnames so we don't have to refer to them with # hardcoded IP addresses. # # vm0: Initial VM we install dependencies and build ZFS on. # vm1..2 Testing VMs for ((i=0; i<=VMs; i++)); do echo "192.168.122.1$i vm$i" | sudo tee -a /etc/hosts done # in case the directory isn't there already mkdir -p $HOME/.ssh cat <> $HOME/.ssh/config # no questions please StrictHostKeyChecking no # small timeout, used in while loops later ConnectTimeout 1 EOF diff --git a/.github/workflows/scripts/qemu-4-build-vm.sh b/.github/workflows/scripts/qemu-4-build-vm.sh index 7583c4ffa3a3..17e976ebcc39 100755 --- a/.github/workflows/scripts/qemu-4-build-vm.sh +++ b/.github/workflows/scripts/qemu-4-build-vm.sh @@ -1,379 +1,379 @@ #!/usr/bin/env bash ###################################################################### # 4) configure and build openzfs modules. This is run on the VMs. # # Usage: # # qemu-4-build-vm.sh OS [--enable-debug][--dkms][--poweroff] # [--release][--repo][--tarball] # # OS: OS name like 'fedora41' # --enable-debug: Build RPMs with '--enable-debug' (for testing) # --dkms: Build DKMS RPMs as well # --poweroff: Power-off the VM after building # --release Build zfs-release*.rpm as well # --repo After building everything, copy RPMs into /tmp/repo # in the ZFS RPM repository file structure. Also # copy tarballs if they were built. # --tarball: Also build a tarball of ZFS source ###################################################################### ENABLE_DEBUG="" DKMS="" POWEROFF="" RELEASE="" REPO="" TARBALL="" while [[ $# -gt 0 ]]; do case $1 in --enable-debug) ENABLE_DEBUG=1 shift ;; --dkms) DKMS=1 shift ;; --poweroff) POWEROFF=1 shift ;; --release) RELEASE=1 shift ;; --repo) REPO=1 shift ;; --tarball) TARBALL=1 shift ;; *) OS=$1 shift ;; esac done set -eu function run() { LOG="/var/tmp/build-stderr.txt" echo "****************************************************" echo "$(date) ($*)" echo "****************************************************" ($@ || echo $? > /tmp/rv) 3>&1 1>&2 2>&3 | stdbuf -eL -oL tee -a $LOG if [ -f /tmp/rv ]; then RV=$(cat /tmp/rv) echo "****************************************************" echo "exit with value=$RV ($*)" echo "****************************************************" echo 1 > /var/tmp/build-exitcode.txt exit $RV fi } # Look at the RPMs in the current directory and copy/move them to # /tmp/repo, using the directory structure we use for the ZFS RPM repos. # # For example: # /tmp/repo/epel-testing/9.5 # /tmp/repo/epel-testing/9.5/SRPMS # /tmp/repo/epel-testing/9.5/SRPMS/zfs-2.3.99-1.el9.src.rpm # /tmp/repo/epel-testing/9.5/SRPMS/zfs-kmod-2.3.99-1.el9.src.rpm # /tmp/repo/epel-testing/9.5/kmod # /tmp/repo/epel-testing/9.5/kmod/x86_64 # /tmp/repo/epel-testing/9.5/kmod/x86_64/debug # /tmp/repo/epel-testing/9.5/kmod/x86_64/debug/kmod-zfs-debuginfo-2.3.99-1.el9.x86_64.rpm # /tmp/repo/epel-testing/9.5/kmod/x86_64/debug/libnvpair3-debuginfo-2.3.99-1.el9.x86_64.rpm # /tmp/repo/epel-testing/9.5/kmod/x86_64/debug/libuutil3-debuginfo-2.3.99-1.el9.x86_64.rpm # ... function copy_rpms_to_repo { # Pick a RPM to query. It doesn't matter which one - we just want to extract # the 'Build Host' value from it. rpm=$(ls zfs-*.rpm | head -n 1) # Get zfs version '2.2.99' zfs_ver=$(rpm -qpi $rpm | awk '/Version/{print $3}') # Get "2.1" or "2.2" zfs_major=$(echo $zfs_ver | grep -Eo [0-9]+\.[0-9]+) # Get 'almalinux9.5' or 'fedora41' type string build_host=$(rpm -qpi $rpm | awk '/Build Host/{print $4}') # Get '9.5' or '41' OS version os_ver=$(echo $build_host | grep -Eo '[0-9\.]+$') # Our ZFS version and OS name will determine which repo the RPMs # will go in (regular or testing). Fedora always gets the newest # releases, and Alma gets the older releases. case $build_host in almalinux*) case $zfs_major in 2.2) d="epel" ;; *) d="epel-testing" ;; esac ;; fedora*) d="fedora" ;; esac prefix=/tmp/repo dst="$prefix/$d/$os_ver" # Special case: move zfs-release*.rpm out of the way first (if we built them). # This will make filtering the other RPMs easier. mkdir -p $dst mv zfs-release*.rpm $dst || true # Copy source RPMs mkdir -p $dst/SRPMS cp $(ls *.src.rpm) $dst/SRPMS/ if [[ "$build_host" =~ "almalinux" ]] ; then # Copy kmods+userspace mkdir -p $dst/kmod/x86_64/debug cp $(ls *.rpm | grep -Ev 'src.rpm|dkms|debuginfo') $dst/kmod/x86_64 cp *debuginfo*.rpm $dst/kmod/x86_64/debug fi if [ -n "$DKMS" ] ; then # Copy dkms+userspace mkdir -p $dst/x86_64 cp $(ls *.rpm | grep -Ev 'src.rpm|kmod|debuginfo') $dst/x86_64 fi # Copy debug mkdir -p $dst/x86_64/debug cp $(ls *debuginfo*.rpm | grep -v kmod) $dst/x86_64/debug } function freebsd() { extra="${1:-}" export MAKE="gmake" echo "##[group]Autogen.sh" run ./autogen.sh echo "##[endgroup]" echo "##[group]Configure" run ./configure \ --prefix=/usr/local \ --with-libintl-prefix=/usr/local \ --enable-pyzfs \ --enable-debuginfo $extra echo "##[endgroup]" echo "##[group]Build" run gmake -j$(sysctl -n hw.ncpu) echo "##[endgroup]" echo "##[group]Install" run sudo gmake install echo "##[endgroup]" } function linux() { extra="${1:-}" echo "##[group]Autogen.sh" run ./autogen.sh echo "##[endgroup]" echo "##[group]Configure" run ./configure \ --prefix=/usr \ --enable-pyzfs \ --enable-debuginfo $extra echo "##[endgroup]" echo "##[group]Build" run make -j$(nproc) echo "##[endgroup]" echo "##[group]Install" run sudo make install echo "##[endgroup]" } function rpm_build_and_install() { extra="${1:-}" # Build RPMs with XZ compression by default (since gzip decompression is slow) echo "%_binary_payload w7.xzdio" >> ~/.rpmmacros echo "##[group]Autogen.sh" run ./autogen.sh echo "##[endgroup]" echo "##[group]Configure" run ./configure --enable-debuginfo $extra echo "##[endgroup]" echo "##[group]Build" run make pkg-kmod pkg-utils echo "##[endgroup]" if [ -n "$DKMS" ] ; then echo "##[group]DKMS" make rpm-dkms echo "##[endgroup]" fi if [ -n "$REPO" ] ; then echo "Skipping install since we're only building RPMs and nothing else" else echo "##[group]Install" run sudo dnf -y --nobest install $(ls *.rpm | grep -Ev 'dkms|src.rpm') echo "##[endgroup]" fi # Optionally build the zfs-release.*.rpm if [ -n "$RELEASE" ] ; then echo "##[group]Release" pushd ~ sudo dnf -y install rpm-build || true # Check out a sparse copy of zfsonlinux.github.com.git so we don't get # all the binaries. We just need a few kilobytes of files to build RPMs. git clone --depth 1 --no-checkout \ https://github.com/zfsonlinux/zfsonlinux.github.com.git cd zfsonlinux.github.com git sparse-checkout set zfs-release git checkout cd zfs-release mkdir -p ~/rpmbuild/{BUILDROOT,SPECS,RPMS,SRPMS,SOURCES,BUILD} cp RPM-GPG-KEY-openzfs* *.repo ~/rpmbuild/SOURCES cp zfs-release.spec ~/rpmbuild/SPECS/ rpmbuild -ba ~/rpmbuild/SPECS/zfs-release.spec # ZFS release RPMs are built. Copy them to the ~/zfs directory just to # keep all the RPMs in the same place. cp ~/rpmbuild/RPMS/noarch/*.rpm ~/zfs cp ~/rpmbuild/SRPMS/*.rpm ~/zfs popd rm -fr ~/rpmbuild echo "##[endgroup]" fi if [ -n "$REPO" ] ; then echo "##[group]Repo" copy_rpms_to_repo echo "##[endgroup]" fi } function deb_build_and_install() { extra="${1:-}" echo "##[group]Autogen.sh" run ./autogen.sh echo "##[endgroup]" echo "##[group]Configure" run ./configure \ --prefix=/usr \ --enable-pyzfs \ --enable-debuginfo $extra echo "##[endgroup]" echo "##[group]Build" run make native-deb-kmod native-deb-utils echo "##[endgroup]" echo "##[group]Install" # Do kmod install. Note that when you build the native debs, the # packages themselves are placed in parent directory '../' rather than # in the source directory like the rpms are. run sudo apt-get -y install $(find ../ | grep -E '\.deb$' \ | grep -Ev 'dkms|dracut') echo "##[endgroup]" } function build_tarball { if [ -n "$REPO" ] ; then ./autogen.sh ./configure --with-config=srpm make dist mkdir -p /tmp/repo/releases # The tarball name is based off of 'Version' field in the META file. mv *.tar.gz /tmp/repo/releases/ fi } # Debug: show kernel cmdline if [ -f /proc/cmdline ] ; then cat /proc/cmdline || true fi # Set our hostname to our OS name and version number. Specifically, we set the # major and minor number so that when we query the Build Host field in the RPMs # we build, we can see what specific version of Fedora/Almalinux we were using # to build them. This is helpful for matching up KMOD versions. # # Examples: # # rhel8.10 # almalinux9.5 -# fedora40 +# fedora42 source /etc/os-release sudo hostname "$ID$VERSION_ID" # save some sysinfo uname -a > /var/tmp/uname.txt cd $HOME/zfs export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" extra="" if [ -n "$ENABLE_DEBUG" ] ; then extra="--enable-debug" fi # build case "$OS" in freebsd*) freebsd "$extra" ;; alma*|centos*) rpm_build_and_install "--with-spec=redhat $extra" ;; fedora*) rpm_build_and_install "$extra" # Historically, we've always built the release tarballs on Fedora, since # there was one instance long ago where we built them on CentOS 7, and they # didn't work correctly for everyone. if [ -n "$TARBALL" ] ; then build_tarball fi ;; debian*|ubuntu*) deb_build_and_install "$extra" ;; *) linux "$extra" ;; esac # building the zfs module was ok echo 0 > /var/tmp/build-exitcode.txt # reset cloud-init configuration and poweroff if [ -n "$POWEROFF" ] ; then sudo cloud-init clean --logs sync && sleep 2 && sudo poweroff & fi exit 0 diff --git a/.github/workflows/zfs-qemu-packages.yml b/.github/workflows/zfs-qemu-packages.yml index 528cc1dcd989..5b5afe746859 100644 --- a/.github/workflows/zfs-qemu-packages.yml +++ b/.github/workflows/zfs-qemu-packages.yml @@ -1,140 +1,140 @@ # This workflow is used to build and test RPM packages. It is a # 'workflow_dispatch' workflow, which means it gets run manually. # # The workflow has a dropdown menu with two options: # # Build RPMs - Build release RPMs and tarballs and put them into an artifact # ZIP file. The directory structure used in the ZIP file mirrors # the ZFS yum repo. # # Test repo - Test install the ZFS RPMs from the ZFS repo. On EL distos, this # will do a DKMS and KMOD test install from both the regular and # testing repos. On Fedora, it will do a DKMS install from the # regular repo. All test install results will be displayed in the # Summary page. Note that the workflow provides an optional text # text box where you can specify the full URL to an alternate repo. # If left blank, it will install from the default repo from the # zfs-release RPM (http://download.zfsonlinux.org). # # Most users will never need to use this workflow. It will be used primary by # ZFS admins for building and testing releases. # name: zfs-qemu-packages on: workflow_dispatch: inputs: test_type: type: choice required: false default: "Build RPMs" description: "Build RPMs or test the repo?" options: - "Build RPMs" - "Test repo" repo_url: type: string required: false default: "" description: "(optional) repo URL (blank: use http://download.zfsonlinux.org)" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: zfs-qemu-packages-jobs: name: qemu-VMs strategy: fail-fast: false matrix: - os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora40', 'fedora41', 'fedora42'] + os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora41', 'fedora42'] runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup QEMU timeout-minutes: 10 run: .github/workflows/scripts/qemu-1-setup.sh - name: Start build machine timeout-minutes: 10 run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }} - name: Install dependencies timeout-minutes: 20 run: | .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} - name: Build modules or Test repo timeout-minutes: 30 run: | set -e if [ "${{ github.event.inputs.test_type }}" == "Test repo" ] ; then # Bring VM back up and copy over zfs source .github/workflows/scripts/qemu-prepare-for-build.sh mkdir -p /tmp/repo ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' ${{ github.event.inputs.repo_url }} else .github/workflows/scripts/qemu-4-build.sh --repo --release --dkms --tarball ${{ matrix.os }} fi - name: Prepare artifacts if: always() timeout-minutes: 10 run: | rsync -a zfs@vm0:/tmp/repo /tmp || true .github/workflows/scripts/replace-dupes-with-symlinks.sh /tmp/repo tar -cf ${{ matrix.os }}-repo.tar -C /tmp repo - uses: actions/upload-artifact@v4 id: artifact-upload if: always() with: name: ${{ matrix.os }}-repo path: ${{ matrix.os }}-repo.tar compression-level: 0 retention-days: 2 if-no-files-found: ignore combine_repos: if: always() needs: [zfs-qemu-packages-jobs] name: "Results" runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 id: artifact-download if: always() - name: Test Summary if: always() run: | for i in $(find . -type f -iname "*.tar") ; do tar -xf $i -C /tmp done tar -cf all-repo.tar -C /tmp repo # If we're installing from a repo, print out the summary of the versions # that got installed using Markdown. if [ "${{ github.event.inputs.test_type }}" == "Test repo" ] ; then cd /tmp/repo for i in $(ls *.txt) ; do nicename="$(echo $i | sed 's/.txt//g; s/-/ /g')" echo "### $nicename" >> $GITHUB_STEP_SUMMARY echo "|repo|RPM|URL|" >> $GITHUB_STEP_SUMMARY echo "|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY awk '{print "|"$1"|"$2"|"$3"|"}' $i >> $GITHUB_STEP_SUMMARY done fi - uses: actions/upload-artifact@v4 id: artifact-upload2 if: always() with: name: all-repo path: all-repo.tar compression-level: 0 retention-days: 5 if-no-files-found: ignore diff --git a/.github/workflows/zfs-qemu.yml b/.github/workflows/zfs-qemu.yml index 7c0f451bea09..1d9899ae895f 100644 --- a/.github/workflows/zfs-qemu.yml +++ b/.github/workflows/zfs-qemu.yml @@ -1,193 +1,193 @@ name: zfs-qemu on: push: pull_request: workflow_dispatch: inputs: include_stream9: type: boolean required: false default: false description: 'Test on CentOS 9 stream' include_stream10: type: boolean required: false default: false description: 'Test on CentOS 10 stream' fedora_kernel_ver: type: string required: false default: "" description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: test-config: name: Setup runs-on: ubuntu-24.04 outputs: test_os: ${{ steps.os.outputs.os }} ci_type: ${{ steps.os.outputs.ci_type }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Generate OS config and CI type id: os run: | - FULL_OS='["almalinux8", "almalinux9", "almalinux10", "debian11", "debian12", "fedora40", "fedora41", "fedora42", "freebsd13-4r", "freebsd14-2s", "freebsd15-0c", "ubuntu22", "ubuntu24"]' + FULL_OS='["almalinux8", "almalinux9", "almalinux10", "debian11", "debian12", "fedora41", "fedora42", "freebsd13-4r", "freebsd14-2s", "freebsd15-0c", "ubuntu22", "ubuntu24"]' QUICK_OS='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd14-2r", "ubuntu24"]' # determine CI type when running on PR ci_type="full" if ${{ github.event_name == 'pull_request' }}; then head=${{ github.event.pull_request.head.sha }} base=${{ github.event.pull_request.base.sha }} ci_type=$(python3 .github/workflows/scripts/generate-ci-type.py $head $base) fi if [ "$ci_type" == "quick" ]; then os_selection="$QUICK_OS" else os_selection="$FULL_OS" fi if [ ${{ github.event.inputs.fedora_kernel_ver }} != "" ] ; then # They specified a custom kernel version for Fedora. Use only # Fedora runners. os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]') else # Normal case os_json=$(echo ${os_selection} | jq -c) fi # Add optional runners if [ "${{ github.event.inputs.include_stream9 }}" == 'true' ]; then os_json=$(echo $os_json | jq -c '. += ["centos-stream9"]') fi if [ "${{ github.event.inputs.include_stream10 }}" == 'true' ]; then os_json=$(echo $os_json | jq -c '. += ["centos-stream10"]') fi echo $os_json echo "os=$os_json" >> $GITHUB_OUTPUT echo "ci_type=$ci_type" >> $GITHUB_OUTPUT qemu-vm: name: qemu-x86 needs: [ test-config ] strategy: fail-fast: false matrix: - # rhl: almalinux8, almalinux9, centos-stream9, fedora40, fedora41 + # rhl: almalinux8, almalinux9, centos-stream9, fedora41 # debian: debian11, debian12, ubuntu22, ubuntu24 # misc: archlinux, tumbleweed # FreeBSD variants of 2024-12: # FreeBSD Release: freebsd13-4r, freebsd14-2r # FreeBSD Stable: freebsd13-4s, freebsd14-2s # FreeBSD Current: freebsd15-0c os: ${{ fromJson(needs.test-config.outputs.test_os) }} runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup QEMU timeout-minutes: 10 run: .github/workflows/scripts/qemu-1-setup.sh - name: Start build machine timeout-minutes: 10 run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }} - name: Install dependencies timeout-minutes: 20 run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} ${{ github.event.inputs.fedora_kernel_ver }} - name: Build modules timeout-minutes: 30 run: .github/workflows/scripts/qemu-4-build.sh --poweroff --enable-debug ${{ matrix.os }} - name: Setup testing machines timeout-minutes: 5 run: .github/workflows/scripts/qemu-5-setup.sh - name: Run tests timeout-minutes: 270 run: .github/workflows/scripts/qemu-6-tests.sh env: CI_TYPE: ${{ needs.test-config.outputs.ci_type }} - name: Prepare artifacts if: always() timeout-minutes: 10 run: .github/workflows/scripts/qemu-7-prepare.sh - uses: actions/upload-artifact@v4 id: artifact-upload if: always() with: name: Logs-functional-${{ matrix.os }} path: /tmp/qemu-${{ matrix.os }}.tar if-no-files-found: ignore - name: Test Summary if: always() run: .github/workflows/scripts/qemu-8-summary.sh '${{ steps.artifact-upload.outputs.artifact-url }}' cleanup: if: always() name: Cleanup runs-on: ubuntu-latest needs: [ qemu-vm ] steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - uses: actions/download-artifact@v4 - name: Generating summary run: .github/workflows/scripts/qemu-9-summary-page.sh - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 2 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 3 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 4 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 5 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 6 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 7 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 8 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 9 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 10 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 11 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 12 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 13 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 14 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 15 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 16 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 17 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 18 - name: Generating summary... run: .github/workflows/scripts/qemu-9-summary-page.sh 19 - uses: actions/upload-artifact@v4 with: name: Summary Files path: out-*