2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-10-20 06:35:32 +00:00
Files
xcat-dep/.github/workflows/genesis-openembedded.yml
T
Daniel Hilst 7b450d7c08 test(xcat-dep): the aarch64 regression skips its image checks in CI
t/aarch64_target.t was added with the aarch64 build target and no workflow step
ran it. Adding the step alone is not enough: the four checks that run the spec's
own grub2-mkimage command skip unless the arm64-efi grub modules are installed
and the tool is on PATH, and both were missing on the runner.

Debian and Ubuntu name the tool grub-mkimage, so looking only for the EL name
skips exactly where the suite runs. The test now resolves either name and
substitutes it into the spec's command.

grub-efi-arm64-bin is Architecture: arm64 and cannot be installed on the amd64
runner, but the modules in it are target code, so the workflow extracts the deb
from ports.ubuntu.com instead of enabling a foreign architecture, and fails when
the extraction yields no modules.

Measured in an ubuntu:24.04 container with the workflow's own steps: the
upstream test reports 4 skips, `# skip grub2-mkimage or the arm64-efi grub
modules are not installed`, and this one reports 0 with all four image checks
passing. The workflow also runs t/aarch64_cross_build.t.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-09 06:35:52 -03:00

121 lines
4.9 KiB
YAML

name: Genesis OpenEmbedded packages
on:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
package-tests:
runs-on: ubuntu-24.04
env:
XCAT_GENESIS_CI: 1
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
apt-utils bats createrepo-c dpkg-dev gnupg \
libfile-slurper-perl \
libparallel-forkmanager-perl libperl-critic-perl rpm rpm2cpio cpio \
grub-common curl ca-certificates
- name: Install the arm64-efi grub modules
# t/aarch64_target.t runs the spec's own grub2-mkimage command, and it skips when the
# arm64-efi modules are absent -- which is a skip exactly where the suite runs, so it
# measures nothing. grub-efi-arm64-bin is Architecture: arm64 and cannot be installed on
# the amd64 runner, but the modules inside it are target code, not host code, so
# extracting the deb puts them in place without enabling a foreign architecture.
run: |
set -euo pipefail
base=http://ports.ubuntu.com/ubuntu-ports/pool/main/g/grub2-unsigned
deb=$(curl -sS "$base/" | grep -oE 'grub-efi-arm64-bin_[^"]*_arm64\.deb' | sort -u | tail -1)
[ -n "$deb" ] || { echo "no grub-efi-arm64-bin deb found under $base" >&2; exit 1; }
curl -sSO "$base/$deb"
sudo dpkg -x "$deb" /
# The modules are what the test needs; say so on the branch that earned it.
n=$(ls /usr/lib/grub/arm64-efi 2>/dev/null | wc -l)
[ "$n" -gt 0 ] || { echo "the deb extracted no arm64-efi modules" >&2; exit 1; }
echo "installed $n arm64-efi grub modules from $deb"
- name: Run static checks
run: |
perl -c genesis-openembedded/build
perl -c genesis-openembedded/package
perl -c genesis-openembedded/verify-release
perl -Ilib -c lib/XCAT/BuildUtils.pm
perl -Ilib -c lib/XCAT/GenesisRelease.pm
perl -c mockbuild-all.pl
perl -c BuildUtils.pm
perl -c sbuild-all.pl
perl -c ipxe-xcat/mockbuild.pl
perl -c ipxe-xcat/sbuild.pl
perl -c ipxe-xcat/verify-payload.pl
rpmspec -P ipxe-xcat/ipxe-xcat.spec >/dev/null
rpmspec -P \
-D 'genesis_arch x86_64' \
-D 'version 2.19.0' \
-D 'release snap202608210726' \
genesis-openembedded/rpm/xCAT-genesis-openembedded.spec >/dev/null
perlcritic \
genesis-openembedded/build \
genesis-openembedded/package \
genesis-openembedded/verify-release \
ipxe-xcat/mockbuild.pl \
ipxe-xcat/sbuild.pl \
ipxe-xcat/verify-payload.pl \
lib/XCAT/BuildUtils.pm \
lib/XCAT/GenesisRelease.pm \
mockbuild-all.pl \
t/build_utils.t \
t/common-repo-gate.t \
t/genesis_openembedded_release.t \
t/genesis_openembedded_consumer.t \
t/ipxe_xcat_payload.t \
t/lib/XCAT/GenesisReleaseTest.pm
- name: Run package tests
run: |
prove -v t/build_utils.t
prove -v t/build_timeout.t
prove -v t/sbuild-all.t
prove -v t/goconserver_cross_build.t
prove -v t/ipxe_xcat_payload.t
prove -v t/mockbuild-all.t
prove -v t/net_dns_rr_types.t
prove -v t/repo-lock-race.t
prove -v t/nfslock.t
prove -v -It/lib t/genesis_openembedded_release.t
sudo -E prove -v -It/lib t/genesis_openembedded_consumer.t
prove -v t/riscv64_perl_cell.t
prove -v t/aarch64_target.t
prove -v t/aarch64_cross_build.t
sudo -E prove -v -It/lib t/common-repo-gate.t
prove -v t/openeuler.t
prove -v t/openeuler_mock_template_include.t
prove -v t/openeuler_native_result_permissions.t
prove -v -Ilib t/openeuler_native_procenv_plugin.t
prove -v -Ilib t/openeuler_native_trust_dbpath.t
prove -v -Ilib t/openeuler_native_cpio_scan.t
bats t/verify-xcatsn-install.bats
# Ubuntu's AppArmor policy blocks these unprivileged test namespaces.
- name: Run native packaging tests
run: |
set -o pipefail
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
prove -v native/buildinfo_provenance.t native/goconserver-openeuler.t \
native/openeuler-power-inputs.t native/openeuler-srpm.t \
native/xnba-release-suffix.t 2>&1 | tee native.tap
# prove returns success when a test file skips all its checks.
if grep -E '^1\.\.0 # SKIP|^native/[^ ]+\.t \.+ skipped' native.tap; then
echo 'a native test file was skipped' >&2
exit 1
fi