mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Like we do for the FreeBSD builds, introduce some basic smoke testing of the built binary using the XTF selftest image. Note this is only done for the x86 build, there's no ARM support in XTF yet. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
213 lines
5.5 KiB
YAML
213 lines
5.5 KiB
YAML
## FreeBSD Build Jobs
|
|
|
|
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
|
|
freebsd_versions: &FREEBSD_VERSIONS
|
|
env:
|
|
FREEBSD_LEGACY: freebsd-13-5
|
|
FREEBSD_PRODUCTION: freebsd-14-3
|
|
FREEBSD_CURRENT: freebsd-15-0-amd64-ufs
|
|
|
|
# Build jobs
|
|
|
|
freebsd_template: &FREEBSD_ENV
|
|
environment:
|
|
APPEND_LIB: /usr/local/lib
|
|
APPEND_INCLUDES: /usr/local/include
|
|
CIRRUS_CLONE_DEPTH: 1
|
|
CIRRUS_LOG_TIMESTAMP: true
|
|
|
|
freebsd_template_latest: &FREEBSD_ENV_PRODUCTION
|
|
<< : *FREEBSD_VERSIONS
|
|
freebsd_instance:
|
|
image_family: $FREEBSD_PRODUCTION
|
|
<< : *FREEBSD_ENV
|
|
|
|
freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
|
|
always:
|
|
rename_script:
|
|
- cp xen/.config xen-config
|
|
config_artifacts:
|
|
path: xen-config
|
|
type: text/plain
|
|
|
|
task:
|
|
name: 'FreeBSD: full build'
|
|
|
|
# It's not possible to use the matrix keyword in YAML aliases, as they
|
|
# keyword usage is restricted to task, docker_builder or pipe. Attempting to
|
|
# use a YAML alias with the duplicated keys doesn't work either. Use an env
|
|
# variable so the version can also be appended to the task alias.
|
|
<< : *FREEBSD_VERSIONS
|
|
env:
|
|
matrix:
|
|
FREEBSD_VERSION: $FREEBSD_LEGACY
|
|
FREEBSD_VERSION: $FREEBSD_PRODUCTION
|
|
FREEBSD_VERSION: $FREEBSD_CURRENT
|
|
|
|
alias: freebsd_full_$FREEBSD_VERSION
|
|
freebsd_instance:
|
|
image_family: $FREEBSD_VERSION
|
|
|
|
<< : *FREEBSD_ENV
|
|
|
|
install_script: pkg install -y seabios gmake ninja bash
|
|
pkgconf bison perl5
|
|
json-c lzo2 pixman argp-standalone
|
|
libxml2 glib git python3 libinotify
|
|
|
|
configure_script:
|
|
- cc --version
|
|
- ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
|
|
--with-extra-qemuu-configure-args="--extra-ldflags=-L${APPEND_LIB} --extra-cflags=-I${APPEND_INCLUDES}"
|
|
- gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
|
|
|
|
<< : *FREEBSD_CONFIGURE_ARTIFACTS
|
|
|
|
build_script:
|
|
- gmake -j`sysctl -n hw.ncpu` clang=y
|
|
|
|
xen_artifacts:
|
|
path: xen/xen
|
|
type: application/octet-stream
|
|
|
|
debug_artifacts:
|
|
path: xen/xen-syms
|
|
type: application/octet-stream
|
|
|
|
task:
|
|
name: 'FreeBSD: randconfig build'
|
|
|
|
# It's not possible to use the matrix keyword in YAML aliases, as they
|
|
# keyword usage is restricted to task, docker_builder or pipe. Attempting to
|
|
# use a YAML alias with the duplicated `image_family` keys doesn't work
|
|
# either. Abstract the version numbers at least.
|
|
<< : *FREEBSD_VERSIONS
|
|
freebsd_instance:
|
|
matrix:
|
|
image_family: $FREEBSD_LEGACY
|
|
image_family: $FREEBSD_PRODUCTION
|
|
image_family: $FREEBSD_CURRENT
|
|
|
|
<< : *FREEBSD_ENV
|
|
|
|
install_script: pkg install -y gmake python3 bison
|
|
|
|
configure_script:
|
|
- cc --version
|
|
- gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
|
|
KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
|
|
|
|
<< : *FREEBSD_CONFIGURE_ARTIFACTS
|
|
|
|
build_script:
|
|
- gmake -j`sysctl -n hw.ncpu` build-xen clang=y
|
|
|
|
task:
|
|
name: 'FreeBSD: XTF build'
|
|
alias: xtf
|
|
|
|
<< : *FREEBSD_ENV_PRODUCTION
|
|
|
|
clone_script:
|
|
- pkg install -y git
|
|
- git clone --depth 1 https://xenbits.xen.org/git-http/xtf.git
|
|
|
|
install_script: pkg install -y gmake
|
|
|
|
build_script:
|
|
- cd xtf
|
|
- cc --version
|
|
- git rev-parse HEAD
|
|
- gmake -j`sysctl -n hw.ncpu` LLVM=y
|
|
|
|
xtf_artifacts:
|
|
path: xtf/tests/selftest/test-*-selftest
|
|
type: application/octet-stream
|
|
|
|
## macOS Build Jobs
|
|
|
|
task:
|
|
name: 'macOS: hypervisor build'
|
|
|
|
env:
|
|
matrix:
|
|
ARCH: x86_64
|
|
ARCH: aarch64
|
|
|
|
alias: macos-$ARCH
|
|
macos_instance:
|
|
image: ghcr.io/cirruslabs/macos-runner:sonoma
|
|
|
|
environment:
|
|
CIRRUS_CLONE_DEPTH: 1
|
|
CIRRUS_LOG_TIMESTAMP: true
|
|
|
|
install_script:
|
|
- brew install $ARCH-elf-gcc $ARCH-elf-binutils
|
|
|
|
build_script:
|
|
- make -j`sysctl -n hw.ncpu`
|
|
XEN_TARGET_ARCH=`echo $ARCH | sed -e s/aarch64/arm64/`
|
|
CROSS_COMPILE=$ARCH-elf- HOSTCC=clang -C xen
|
|
|
|
xen_artifacts:
|
|
path: xen/xen
|
|
type: application/octet-stream
|
|
|
|
debug_artifacts:
|
|
path: xen/xen-syms
|
|
type: application/octet-stream
|
|
|
|
## Test Jobs
|
|
|
|
task:
|
|
name: 'XTF selftest'
|
|
|
|
<< : *FREEBSD_ENV_PRODUCTION
|
|
|
|
env:
|
|
matrix:
|
|
BUILD: freebsd_full_$FREEBSD_LEGACY
|
|
BUILD: freebsd_full_$FREEBSD_PRODUCTION
|
|
BUILD: freebsd_full_$FREEBSD_CURRENT
|
|
BUILD: macos-x86_64
|
|
|
|
depends_on:
|
|
- $BUILD
|
|
- xtf
|
|
|
|
install_script: pkg install -y qemu-nox11 expect
|
|
|
|
env:
|
|
matrix:
|
|
XTF_ARCH: hvm32
|
|
XTF_ARCH: hvm32pae
|
|
XTF_ARCH: hvm32pse
|
|
XTF_ARCH: hvm64
|
|
XTF_ARCH: pv64
|
|
|
|
fetch_script:
|
|
- fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/xtf/xtf.zip
|
|
- fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/$BUILD/xen.zip
|
|
- unzip xtf.zip
|
|
- unzip xen.zip
|
|
|
|
test_script: |
|
|
case "$XTF_ARCH" in \
|
|
*hvm*) \
|
|
XEN_EXTRA_CMD="dom0=pvh dom0-iommu=none" \
|
|
;; \
|
|
esac
|
|
export TEST_CMD="qemu-system-x86_64 -kernel xen/xen -initrd xtf/tests/selftest/test-${XTF_ARCH}-selftest \
|
|
-append \"loglvl=all console=com1 noreboot console_timestamps=boot dom0=verbose ${XEN_EXTRA_CMD}\" \
|
|
-m 512 -nographic -monitor none -serial stdio"
|
|
export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
|
|
export PASSED="Test result: SUCCESS"
|
|
export TEST_TIMEOUT=120
|
|
./automation/scripts/console.exp 2>&1 | sed 's/\r\+$//'
|
|
|
|
always:
|
|
serial_artifacts:
|
|
path: serial-*.txt
|
|
type: text/plain
|