Let's not build the tools tree as part of running the tests anymore.
Instead, let's just build it manually up front.
chmod +x "mkosi.${script}"
done
+ - name: Build tools tree
+ run: |
+ # TODO: Remove grub2 hack when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved.
+ sudo --preserve-env \
+ mkosi \
+ --directory "" \
+ --distribution ${{ matrix.tools }} \
+ --include mkosi-tools \
+ $( [[ ${{ matrix.tools }} == opensuse ]] && echo --package=grub2)
+
- name: Run integration tests
run: |
sudo --preserve-env \
--verbose \
-m integration \
--distribution ${{ matrix.distro }} \
- --tools-tree-distribution ${{ matrix.tools }} \
tests/
/mkosi.rootpw
mkosi.local
mkosi.local.conf
+mkosi.tools
/mkosi.key
/mkosi.crt
__pycache__
[Match]
Architecture=x86-64
-# We cannot install the grub tools in the OpenSUSE tools tree due to
-# https://bugzilla.opensuse.org/show_bug.cgi?id=1227464.
-# TODO: Remove this again when the above bug is resolved.
-ToolsTreeDistribution=!opensuse
[Content]
BiosBootloader=grub
class ImageConfig:
distribution: Distribution
release: str
- tools_tree_distribution: Optional[Distribution]
- tools_tree_release: Optional[str]
debug_shell: bool
opt: list[PathString] = [
"--distribution", str(self.config.distribution),
"--release", self.config.release,
- *(["--tools-tree=default"] if self.config.tools_tree_distribution else []),
- *(
- ["--tools-tree-distribution", str(self.config.tools_tree_distribution)]
- if self.config.tools_tree_distribution
- else []
- ),
- *(["--tools-tree-release", self.config.tools_tree_release] if self.config.tools_tree_release else []), # noqa
*(f"--kernel-command-line={i}" for i in kcl),
"--force",
"--incremental",
metavar="RELEASE",
help="Run the integration tests for the given release.",
)
- parser.addoption(
- "-T",
- "--tools-tree-distribution",
- metavar="DISTRIBUTION",
- help="Use the given tools tree distribution to build the integration test images",
- type=Distribution,
- choices=[Distribution(d) for d in Distribution.values()],
- )
- parser.addoption(
- "--tools-tree-release",
- metavar="RELEASE",
- help="Use the given tools tree release instead of the default one",
- )
parser.addoption(
"--debug-shell",
help="Pass --debug-shell when running mkosi",
return ImageConfig(
distribution=distribution,
release=release,
- tools_tree_distribution=cast(Distribution, request.config.getoption("--tools-tree-distribution")),
- tools_tree_release=request.config.getoption("--tools-tree-release"),
debug_shell=request.config.getoption("--debug-shell"),
)
if have_vmspawn() and format in (OutputFormat.disk, OutputFormat.directory):
image.vmspawn()
- # TODO: Remove the opensuse check again when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is
- # resolved and we install the grub tools in the openSUSE tools tree again.
- if format != OutputFormat.disk or config.tools_tree_distribution == Distribution.opensuse:
+ if format != OutputFormat.disk:
return
image.qemu(["--qemu-firmware=bios"])
if config.distribution == Distribution.rhel_ubi:
return
- # TODO: Remove this again when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved and we
- # install the grub tools in the openSUSE tools tree again.
- if bootloader == Bootloader.grub and config.tools_tree_distribution == Distribution.opensuse:
- return
-
firmware = QemuFirmware.linux if bootloader == Bootloader.none else QemuFirmware.auto
with Image(config) as image: