diff options
-rw-r--r-- | .github/workflows/mkosi.yml | 294 |
1 files changed, 147 insertions, 147 deletions
diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 2354429611..d77307fe42 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -10,36 +10,36 @@ on: - main - v[0-9]+-stable paths: - - '**' - - '!README*' - - '!LICENSE*' - - '!LICENSES/**' - - '!TODO' - - '!docs/**' - - '!man/**' - - '!catalog/**' - - '!shell-completion/**' - - '!po/**' - - '!.**' - - '.github/**' + - "**" + - "!README*" + - "!LICENSE*" + - "!LICENSES/**" + - "!TODO" + - "!docs/**" + - "!man/**" + - "!catalog/**" + - "!shell-completion/**" + - "!po/**" + - "!.**" + - ".github/**" pull_request: branches: - main - v[0-9]+-stable paths: - - '**' - - '!README*' - - '!LICENSE*' - - '!LICENSES/**' - - '!TODO' - - '!docs/**' - - '!man/**' - - '!catalog/**' - - '!shell-completion/**' - - '!po/**' - - '!.**' - - '.github/**' + - "**" + - "!README*" + - "!LICENSE*" + - "!LICENSES/**" + - "!TODO" + - "!docs/**" + - "!man/**" + - "!catalog/**" + - "!shell-completion/**" + - "!po/**" + - "!.**" + - ".github/**" permissions: contents: read @@ -104,126 +104,126 @@ jobs: relabel: yes steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: systemd/mkosi@63fc1fde5b1aac1abf07ac499068c2b62263dafb - - # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space - # immediately, we remove the files in the background. However, we first move them to a different location - # so that nothing tries to use anything in these directories anymore while we're busy deleting them. - - name: Free disk space - run: | - sudo mv /usr/local /usr/local.trash - sudo mv /opt/hostedtoolcache /opt/hostedtoolcache.trash - sudo systemd-run rm -rf /usr/local.trash /opt/hostedtoolcache.trash - - - name: Btrfs - run: | - truncate --size=100G btrfs.raw - mkfs.btrfs btrfs.raw - sudo mkdir /mnt/mkosi - LOOP="$(sudo losetup --find --show --direct-io=on btrfs.raw)" - sudo mount "$LOOP" /mnt/mkosi --options compress=zstd:1,user_subvol_rm_allowed,noatime,discard=async,space_cache=v2 - sudo chown "$(id -u):$(id -g)" /mnt/mkosi - mkdir /mnt/mkosi/tmp - echo "TMPDIR=/mnt/mkosi/tmp" >>"$GITHUB_ENV" - ln -s /mnt/mkosi/build build - - - name: Configure - run: | - # XXX: drop after the HyperV bug that breaks secure boot KVM guests is solved - sed -i "s/'firmware'\s*:\s*'auto'/'firmware' : 'uefi'/g" test/*/meson.build - tee mkosi.local.conf <<EOF - [Distribution] - Distribution=${{ matrix.distro }} - Release=${{ matrix.release }} - - [Output] - # Build a disk image in CI as this logic is much more prone to breakage. - Format=disk - UseSubvolumes=yes - - WorkspaceDirectory=$TMPDIR - PackageCacheDirectory=$TMPDIR/cache - - [Content] - Environment= - # Build debuginfo packages since we'll be publishing the packages as artifacts. - WITH_DEBUG=1 - CFLAGS="${{ matrix.cflags }}" - SANITIZERS=${{ matrix.sanitizers }} - MESON_OPTIONS=--werror - LLVM=${{ matrix.llvm }} - SYSEXT=1 - - SELinuxRelabel=${{ matrix.relabel }} - - [Host] - QemuMem=4G - EOF - - - name: Generate secure boot key - run: mkosi --debug genkey - - - name: Show image summary - run: mkosi summary - - - name: Install dependencies - run: | - mkosi dependencies | - xargs -d '\n' sudo apt-get install \ - gperf \ - libblkid-dev \ - libcap-dev \ - libcryptsetup-dev \ - libcurl4-openssl-dev \ - libfdisk-dev \ - libmicrohttpd-dev \ - libmount-dev \ - libtss2-dev \ - meson - - - name: Configure meson - run: | - meson setup build \ - --buildtype=debugoptimized \ - -Dintegration-tests=true \ - -Dremote=enabled \ - -Dopenssl=enabled \ - -Dblkid=enabled \ - -Dtpm2=enabled \ - -Dlibcryptsetup=enabled \ - -Dlibcurl=enabled \ - -Drepart=enabled \ - -Dfirstboot=true \ - -Dsysusers=true \ - -Dtmpfiles=true \ - -Dhwdb=true \ - -Dvmspawn=enabled - - - name: Build image - run: sudo meson compile -C build mkosi - - - name: Run integration tests - run: sudo --preserve-env meson test -C build --no-rebuild --suite integration-tests --print-errorlogs --no-stdsplit --num-processes "$(($(nproc) - 1))" - - - name: Archive failed test journals - uses: actions/upload-artifact@v4 - if: failure() && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable') - with: - name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-failed-test-journals - path: | - build/test/journal/*.journal - build/meson-logs/* - retention-days: 7 - - - name: Archive packages - uses: actions/upload-artifact@v4 - if: (success() || failure()) && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable') - with: - name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-packages - path: | - build/mkosi.output/*.rpm - build/mkosi.output/*.deb - build/mkosi.output/*.ddeb - build/mkosi.output/*.pkg.tar - retention-days: 4 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: systemd/mkosi@2d338abea5770801c2c1afa8dbb829a5cba975dc + + # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space + # immediately, we remove the files in the background. However, we first move them to a different location + # so that nothing tries to use anything in these directories anymore while we're busy deleting them. + - name: Free disk space + run: | + sudo mv /usr/local /usr/local.trash + sudo mv /opt/hostedtoolcache /opt/hostedtoolcache.trash + sudo systemd-run rm -rf /usr/local.trash /opt/hostedtoolcache.trash + + - name: Btrfs + run: | + truncate --size=100G btrfs.raw + mkfs.btrfs btrfs.raw + sudo mkdir /mnt/mkosi + LOOP="$(sudo losetup --find --show --direct-io=on btrfs.raw)" + sudo mount "$LOOP" /mnt/mkosi --options compress=zstd:1,user_subvol_rm_allowed,noatime,discard=async,space_cache=v2 + sudo chown "$(id -u):$(id -g)" /mnt/mkosi + mkdir /mnt/mkosi/tmp + echo "TMPDIR=/mnt/mkosi/tmp" >>"$GITHUB_ENV" + ln -s /mnt/mkosi/build build + + - name: Configure + run: | + # XXX: drop after the HyperV bug that breaks secure boot KVM guests is solved + sed -i "s/'firmware'\s*:\s*'auto'/'firmware' : 'uefi'/g" test/*/meson.build + tee mkosi.local.conf <<EOF + [Distribution] + Distribution=${{ matrix.distro }} + Release=${{ matrix.release }} + + [Output] + # Build a disk image in CI as this logic is much more prone to breakage. + Format=disk + UseSubvolumes=yes + + WorkspaceDirectory=$TMPDIR + PackageCacheDirectory=$TMPDIR/cache + + [Content] + Environment= + # Build debuginfo packages since we'll be publishing the packages as artifacts. + WITH_DEBUG=1 + CFLAGS="${{ matrix.cflags }}" + SANITIZERS=${{ matrix.sanitizers }} + MESON_OPTIONS=--werror + LLVM=${{ matrix.llvm }} + SYSEXT=1 + + SELinuxRelabel=${{ matrix.relabel }} + + [Host] + QemuMem=4G + EOF + + - name: Generate secure boot key + run: mkosi --debug genkey + + - name: Show image summary + run: mkosi summary + + - name: Install dependencies + run: | + mkosi dependencies | + xargs -d '\n' sudo apt-get install \ + gperf \ + libblkid-dev \ + libcap-dev \ + libcryptsetup-dev \ + libcurl4-openssl-dev \ + libfdisk-dev \ + libmicrohttpd-dev \ + libmount-dev \ + libtss2-dev \ + meson + + - name: Configure meson + run: | + meson setup build \ + --buildtype=debugoptimized \ + -Dintegration-tests=true \ + -Dremote=enabled \ + -Dopenssl=enabled \ + -Dblkid=enabled \ + -Dtpm2=enabled \ + -Dlibcryptsetup=enabled \ + -Dlibcurl=enabled \ + -Drepart=enabled \ + -Dfirstboot=true \ + -Dsysusers=true \ + -Dtmpfiles=true \ + -Dhwdb=true \ + -Dvmspawn=enabled + + - name: Build image + run: sudo meson compile -C build mkosi + + - name: Run integration tests + run: sudo --preserve-env meson test -C build --no-rebuild --suite integration-tests --print-errorlogs --no-stdsplit --num-processes "$(($(nproc) - 1))" + + - name: Archive failed test journals + uses: actions/upload-artifact@v4 + if: failure() && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable') + with: + name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-failed-test-journals + path: | + build/test/journal/*.journal + build/meson-logs/* + retention-days: 7 + + - name: Archive packages + uses: actions/upload-artifact@v4 + if: (success() || failure()) && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable') + with: + name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-packages + path: | + build/mkosi.output/*.rpm + build/mkosi.output/*.deb + build/mkosi.output/*.ddeb + build/mkosi.output/*.pkg.tar + retention-days: 4 |