Run tests on Cirrus CI, drop Travis

Travis stopped handing out free credits since their plan changes last
November, so tests have not run since then.

Cirrus CI offers an API similar to Travis, and also explicitly supports
/dev/kvm access. They run on the GKE Linux Community Cluster, and thus
are not as likely to run into monetary problems as Travis did.

Eventually we want to use the cockpit/tasks container directly. But we
can't fix the /dev/kvm permissions inside that as `sudo` does not work
in that. Once we fix that, the setup will become much cheaper and
simpler.
This commit is contained in:
Martin Pitt 2021-01-25 10:12:14 +01:00
parent bb06422996
commit fdae5d3a7b
3 changed files with 36 additions and 38 deletions

23
.cirrus.yml Normal file
View file

@ -0,0 +1,23 @@
container:
# We should use quay.io/cockpit/tasks here and avoid package installation, but we can't currently run sudo in that container to fix /dev/kvm permissions
image: docker.io/fedora
kvm: true
# increase this if you have many tests that benefit from parallelism
cpu: 1
test_task:
env:
matrix:
- TEST_OS: fedora-33
- TEST_OS: centos-8-stream
setup_script:
- chmod 666 /dev/kvm
- dnf install -y chromium-headless curl git libappstream-glib libvirt-daemon-kvm libvirt-client libvirt-python3 make npm rpm-build rpmdevtools sassc tar
- useradd build
- chown -R build:build .
# test PO template generation
pot_build_script: su -c 'make po/starter-kit.pot' build
check_script: su -c "TEST_JOBS=$(nproc) TEST_OS=$TEST_OS make check" build