aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.d/cirrus
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2021-12-09 11:31:24 +0100
committerThomas Huth <thuth@redhat.com>2021-12-15 08:08:59 +0100
commitf11b0a4892ae22b8729a75b2232073fb4090ff28 (patch)
tree30fb65c13fbfc33bf565d31c8920bb83ad2b0c30 /.gitlab-ci.d/cirrus
parentf462be4c062959b6c5bf78df235c16b6c09792ab (diff)
gitlab-ci: Add cirrus-ci based tests for NetBSD and OpenBSD
Cirrus-CI provides KVM in their Linux containers, so we can also run our VM-based NetBSD and OpenBSD build jobs there. Since the VM installation might take a while, we only run the "help" target on the first invocation to avoid timeouts, and then only check the build during the next run, once the base image has been cached. For the the build tests, we also only use very a limited set of target CPUs since compiling in these VMs is not very fast (especially the build on OpenBSD seems to be incredibly slow). The jobs are marked as "manual" only, since this double-indirect setup (with the cirrus-run script and VMs in the Cirrus-CI containers) might fail more often than the other jobs, and since we can trigger a limited amount of Cirrus-CI jobs at a time anyway (due to the restrictions in the free tier of Cirrus). Thus these jobs are rather added as convenience for contributors who would like to run the NetBSD/OpenBSD tests without the need of downloading and installing the corresponding VM images on their local machines. Message-Id: <20211209103124.121942-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to '.gitlab-ci.d/cirrus')
-rw-r--r--.gitlab-ci.d/cirrus/kvm-build.yml31
1 files changed, 31 insertions, 0 deletions
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