aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.d
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.d')
-rw-r--r--.gitlab-ci.d/cirrus.yml35
-rw-r--r--.gitlab-ci.d/cirrus/kvm-build.yml31
2 files changed, 66 insertions, 0 deletions
diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml
index d273a9e713..19e6c21401 100644
--- a/.gitlab-ci.d/cirrus.yml
+++ b/.gitlab-ci.d/cirrus.yml
@@ -89,3 +89,38 @@ x64-macos-11-base-build:
PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
+
+
+# The following jobs run VM-based tests via KVM on a Linux-based Cirrus-CI job
+.cirrus_kvm_job:
+ stage: build
+ image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
+ needs: []
+ timeout: 80m
+ allow_failure: true
+ script:
+ - sed -e "s|[@]CI_REPOSITORY_URL@|$CI_REPOSITORY_URL|g"
+ -e "s|[@]CI_COMMIT_REF_NAME@|$CI_COMMIT_REF_NAME|g"
+ -e "s|[@]CI_COMMIT_SHA@|$CI_COMMIT_SHA|g"
+ -e "s|[@]NAME@|$NAME|g"
+ -e "s|[@]CONFIGURE_ARGS@|$CONFIGURE_ARGS|g"
+ -e "s|[@]TEST_TARGETS@|$TEST_TARGETS|g"
+ <.gitlab-ci.d/cirrus/kvm-build.yml >.gitlab-ci.d/cirrus/$NAME.yml
+ - cat .gitlab-ci.d/cirrus/$NAME.yml
+ - cirrus-run -v --show-build-log always .gitlab-ci.d/cirrus/$NAME.yml
+ rules:
+ - when: manual
+
+x86-netbsd:
+ extends: .cirrus_kvm_job
+ variables:
+ NAME: netbsd
+ CONFIGURE_ARGS: --target-list=x86_64-softmmu,ppc64-softmmu,aarch64-softmmu
+ TEST_TARGETS: check
+
+x86-openbsd:
+ extends: .cirrus_kvm_job
+ variables:
+ NAME: openbsd
+ CONFIGURE_ARGS: --target-list=i386-softmmu,riscv64-softmmu,mips64-softmmu
+ TEST_TARGETS: check
diff --git a/.gitlab-ci.d/cirrus/kvm-build.yml b/.gitlab-ci.d/cirrus/kvm-build.yml
new file mode 100644
index 0000000000..4334fabf39
--- /dev/null
+++ b/.gitlab-ci.d/cirrus/kvm-build.yml
@@ -0,0 +1,31 @@
+container:
+ image: fedora:35
+ cpu: 4
+ memory: 8Gb
+ kvm: true
+
+env:
+ CIRRUS_CLONE_DEPTH: 1
+ CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
+ CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
+ CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
+
+@NAME@_task:
+ @NAME@_vm_cache:
+ folder: $HOME/.cache/qemu-vm
+ install_script:
+ - dnf update -y
+ - dnf install -y git make openssh-clients qemu-img qemu-system-x86 wget
+ clone_script:
+ - git clone --depth 100 "$CI_REPOSITORY_URL" .
+ - git fetch origin "$CI_COMMIT_REF_NAME"
+ - git reset --hard "$CI_COMMIT_SHA"
+ build_script:
+ - if [ -f $HOME/.cache/qemu-vm/images/@NAME@.img ]; then
+ make vm-build-@NAME@ J=$(getconf _NPROCESSORS_ONLN)
+ EXTRA_CONFIGURE_OPTS="@CONFIGURE_ARGS@"
+ BUILD_TARGET="@TEST_TARGETS@" ;
+ else
+ make vm-build-@NAME@ J=$(getconf _NPROCESSORS_ONLN) BUILD_TARGET=help
+ EXTRA_CONFIGURE_OPTS="--disable-system --disable-user --disable-tools" ;
+ fi