libvirt/ci
Andrea Bolognani 5d95617ed9 ci: Disable optimizations on macOS
Clang can be too aggressive at optimizations, which can end up
breaking our test suite. See f9f5ab5718 for details.

As a result of this, since 7944700b40 we are automatically
disabling tests when Clang is used unless it supports the
-fsemantic-interposition compiler flag.

Since the version of Clang included in macOS doesn't support that
compiler flag, we end up always disabling the test suite on that
platform.

This is already far from ideal, considering that it was just last
year when we finally managed to get the test suite to successfully
pass on macOS, and it would be a real shame if the situation
regressed again.

With the upcoming changes, which will turn running 'meson test'
into a hard failure if tests are disabled, this behavior will
result in every single pipeline failing.

Work around the problem the only way we can: disabling
optimizations entirely for the macOS CI jobs.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-10-26 11:31:12 +02:00
..
buildenv ci: add libnbd to build 2023-09-19 14:28:50 -05:00
cirrus ci: Disable optimizations on macOS 2023-10-26 11:31:12 +02:00
containers ci: add libnbd to build 2023-09-19 14:28:50 -05:00
gitlab ci: Udate FreeBSD-13 image with lcitool manifest 2023-08-16 14:06:32 +02:00
lcitool ci: add libnbd to build 2023-09-19 14:28:50 -05:00
gitlab.yml ci: Regenerate gitlab CI config with latest lcitool 2023-03-01 14:42:19 +01:00
helper ci: helper: Drop the _make_run method 2023-09-12 11:36:03 +02:00
integration-template.yml ci: integration: Drop the 'install-deps' hidden job and reference 2023-09-19 13:35:58 +02:00
integration.yml ci: integration: Flip QEMU upstream integration tests to Fedora 38 2023-05-10 16:41:21 +02:00
jobs.sh ci: jobs.sh: Define and create SCRATCH_DIR for local executions 2023-09-19 13:35:59 +02:00
manifest.yml ci: Move Debian-11 workloads to Debian-12 2023-08-16 14:05:18 +02:00
README.rst ci: refresh with latest lcitool manifest 2022-10-06 05:15:54 -04:00
util.py scripts: Fix the flake8 syntax-check failures 2023-06-29 11:51:27 +02:00

CI for libvirt

This document provides some information related to the CI capabilities for the libvirt project.

GitLab CI tuning

The behaviour of GitLab CI can be tuned through a number of variables which can be set at push time, or through the UI. See ci/gitlab.yml for further details.

Cirrus CI integration

libvirt currently supports three non-Linux operating systems: Windows, FreeBSD and macOS. Windows cross-builds can be prepared on Linux by using MinGW-w64, but for both FreeBSD and macOS we need to use the actual operating system, and unfortunately GitLab shared runners are currently not available for either.

To work around this limitation, we take advantage of Cirrus CI's free offering: more specifically, we use the cirrus-run script to trigger Cirrus CI jobs from GitLab CI jobs so that the workaround is almost entirely transparent to users and there's no need to constantly check two separate CI dashboards.

There is, however, some one-time setup required. If you want FreeBSD and macOS builds to happen when you push to your GitLab repository, you need to

  • set up a GitHub repository for the project, eg. yourusername/libvirt. This repository needs to exist for cirrus-run to work, but it doesn't need to be kept up to date, so you can create it and then forget about it;

  • enable the Cirrus CI GitHub app for your GitHub account;

  • sign up for Cirrus CI. It's enough to log into the website using your GitHub account;

  • grab an API token from the Cirrus CI settings page;

  • it may be necessary to push an empty .cirrus.yml file to your github fork for Cirrus CI to properly recognize the project. You can check whether Cirrus CI knows about your project by navigating to:

    https://cirrus-ci.com/yourusername/libvirt

  • in the CI/CD / Variables section of the settings page for your GitLab repository, create two new variables:

    • CIRRUS_GITHUB_REPO, containing the name of the GitHub repository created earlier, eg. yourusername/libvirt;
    • CIRRUS_API_TOKEN, containing the Cirrus CI API token generated earlier. This variable must be marked as Masked, because anyone with knowledge of it can impersonate you as far as Cirrus CI is concerned.

    Neither of these variables should be marked as Protected, because in general you'll want to be able to trigger Cirrus CI builds from non-protected branches.

Once this one-time setup is complete, you can just keep pushing to your GitLab repository as usual and you'll automatically get the additional CI coverage.

Coverity scan integration

This will be used only by the main repository for master branch by running scheduled pipeline in GitLab.

The service is proved by Coverity Scan and requires that the project is registered there to get free coverity analysis which we already have for libvirt project.

To run the coverity job it requires two new variables: