2022-05-06 07:02:23 +00:00
|
|
|
.qemu-build-template: &qemu-build-template
|
2024-01-12 10:02:56 +00:00
|
|
|
- pushd "$SCRATCH_DIR"
|
2022-05-06 07:02:23 +00:00
|
|
|
- git clone --depth 1 https://gitlab.com/qemu-project/qemu.git
|
|
|
|
- cd qemu
|
|
|
|
#
|
|
|
|
# inspired by upstream QEMU's buildtest-template.yml
|
|
|
|
- export JOBS="$(expr $(nproc) + 1)"
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- ../configure --prefix=/usr
|
|
|
|
--enable-werror
|
|
|
|
--disable-tcg
|
|
|
|
--disable-docs
|
|
|
|
--target-list=x86_64-softmmu || (cat config.log meson-logs/meson-log.txt && exit 1)
|
|
|
|
- make -j"$JOBS"
|
|
|
|
- if test -n "$MAKE_CHECK_ARGS";
|
|
|
|
then
|
|
|
|
make -j"$JOBS" check-build;
|
|
|
|
fi
|
2022-06-07 12:51:14 +00:00
|
|
|
|
|
|
|
# we need the following since the fix for CVE-2022-24765 now causes a fatal
|
|
|
|
# error if a user issues a git command from within a directory owned by some
|
|
|
|
# other user
|
|
|
|
- sudo git config --global --add safe.directory "$SCRATCH_DIR/qemu"
|
2022-05-06 07:02:23 +00:00
|
|
|
- sudo make install
|
2024-01-12 10:02:56 +00:00
|
|
|
- sudo restorecon -R /usr
|
|
|
|
- popd
|
2022-05-06 07:01:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
.collect-logs: &collect-logs
|
2022-10-14 10:36:06 +00:00
|
|
|
- set +e
|
2022-10-13 08:59:08 +00:00
|
|
|
- shopt -s nullglob
|
2022-05-06 07:01:28 +00:00
|
|
|
- mkdir logs
|
2022-10-14 10:24:59 +00:00
|
|
|
- test -d "$SCRATCH_DIR"/avocado && mkdir logs/avocado
|
2022-10-14 07:35:04 +00:00
|
|
|
- sudo coredumpctl &>/dev/null && sudo coredumpctl info --no-pager > logs/coredumpctl.txt
|
2022-05-06 07:01:28 +00:00
|
|
|
- sudo mv /var/log/libvirt logs/libvirt
|
2022-10-13 08:59:08 +00:00
|
|
|
# filter only the failed tests, omitting successful job logs
|
|
|
|
- for test_log in "$SCRATCH_DIR"/avocado/latest/test-results/by-status/{ERROR,FAIL}/*;
|
|
|
|
do
|
|
|
|
sudo mv "$(realpath $test_log)" logs/avocado;
|
|
|
|
done;
|
2022-05-06 07:01:28 +00:00
|
|
|
- sudo chown -R $(whoami):$(whoami) logs
|
|
|
|
# rename all Avocado stderr/stdout logs to *.log so that GitLab's web UI doesn't mangle the MIME type
|
|
|
|
- find logs/avocado/ -type f ! -name "*.log" -exec
|
|
|
|
sh -c 'DIR=$(dirname {}); NAME=$(basename {}); mv $DIR/$NAME{,.log}' \;
|
|
|
|
|
|
|
|
|
2022-05-06 06:16:46 +00:00
|
|
|
.integration_tests:
|
|
|
|
stage: integration_tests
|
2024-01-18 15:20:14 +00:00
|
|
|
rules:
|
|
|
|
- if: '$LIBVIRT_CI_INTEGRATION == null'
|
|
|
|
when: never
|
|
|
|
- !reference [.gitlab_native_build_job, rules]
|
2022-05-06 06:16:46 +00:00
|
|
|
before_script:
|
|
|
|
- mkdir "$SCRATCH_DIR"
|
2023-01-20 09:19:52 +00:00
|
|
|
- sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/* libvirt-python-rpms/*
|
2022-05-06 06:16:46 +00:00
|
|
|
script:
|
2023-09-15 12:23:21 +00:00
|
|
|
- source ci/jobs.sh
|
|
|
|
- run_integration
|
2022-05-06 06:16:46 +00:00
|
|
|
after_script:
|
|
|
|
- test "$CI_JOB_STATUS" = "success" && exit 0;
|
2022-05-06 07:01:28 +00:00
|
|
|
- *collect-logs
|
2022-05-06 06:16:46 +00:00
|
|
|
variables:
|
|
|
|
SCRATCH_DIR: "/tmp/scratch"
|
|
|
|
artifacts:
|
|
|
|
name: logs
|
2023-01-12 06:57:58 +00:00
|
|
|
expire_in: 1 day
|
2022-05-06 06:16:46 +00:00
|
|
|
paths:
|
|
|
|
- logs
|
|
|
|
when: on_failure
|
ci: refresh with latest lcitool manifest
This refresh switches the CI for contributors to be triggered by merge
requests. Pushing to a branch in a fork will no longer run CI pipelines,
in order to avoid consuming CI minutes. To regain the original behaviour
contributors can opt-in to a pipeline on push
git push <remote> -o ci.variable=RUN_PIPELINE=1
This variable can also be set globally on the repository, through the
web UI options Settings -> CI/CD -> Variables, though this is not
recommended. Upstream repo pushes to branches will run CI.
The use of containers has changed in this update, with only the upstream
repo creating containers, in order to avoid consuming contributors'
limited storage quotas. A fork with existing container images may delete
them. Containers will be rebuilt upstream when pushing commits with CI
changes to the default branch. Any other scenario with CI changes will
simply install build pre-requisite packages in a throaway environment,
using the ci/buildenv/ scripts. These scripts may also be used on a
contributor's local machines.
With pipelines triggered by merge requests, it is also now possible to
workaround the inability of contributors to run pipelines if they have
run out of CI quota. A project member can trigger a pipeline from the
merge request, which will run in context of upstream, however, note
this should only be done after reviewing the code for any malicious
CI changes.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-09-30 08:50:04 +00:00
|
|
|
|
2022-05-06 13:16:43 +00:00
|
|
|
|
|
|
|
# YAML anchors don't work with Shell conditions so we can't use a variable
|
|
|
|
# to conditionally build+install QEMU from source.
|
|
|
|
# Instead, create a new test job template for this scenario.
|
|
|
|
.integration_tests_upstream_qemu:
|
2024-01-18 15:20:14 +00:00
|
|
|
extends:
|
|
|
|
- .integration_tests
|
2022-05-06 13:16:43 +00:00
|
|
|
before_script:
|
|
|
|
- !reference [.integration_tests, before_script]
|
|
|
|
- *qemu-build-template
|