Commit Graph

81 Commits

Author SHA1 Message Date
Florian Müllner
4bbe61d47e ci: Move test setup into template job
This will allow sharing the setup between test jobs and a future
dist job.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1980>
2021-09-05 00:15:56 +02:00
Florian Müllner
f41b165f9c ci: Add asciidoc to image
gnome-shell uses it to pre-generate man pages at dist time.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1980>
2021-09-05 00:15:56 +02:00
Marco Trevisan (Treviño)
bf54a16f92 tests: Add MetaOrientationManager tests via SensorsProxy mock
Create a test system bus and use it to run all the tests, add a mock
SensorsProxy (via dbusmock template) server that implements the
net.hadess.SensorProxy interface.

To make testing easier, the service is created on request of a proxy for
it, whose lifetime controls the mock service lifetime as well.
This is done using a further mock service that is used to manage the
others, using python-dbusmock to simplify the handling.

Add basic tests for the orientation manager.

As per the usage dbusmock, we're now launching all the tests under such
wrapper, so that local dbus environment won't ever considered, and
there's no risk that it may affect the tests results both locally and in
CI.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233>
2021-09-04 10:04:00 +02:00
Florian Müllner
0f8ae7c507 ci: Build gjs from git
... to allow gnome-shell to bump its dependency for
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1958

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1975>
2021-08-30 20:11:57 +00:00
Robert Mader
5a25f2f62b ci: Use target branch from target project for code-style check
Merge requests from forked projects run pipelines in their context,
not the target projects one. Thus we have to fetch the target
branch from the target repository.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1977>
2021-08-27 12:48:36 +02:00
Robert Mader
264c625b79 ci: Fetch the right target branch
And remove a superfluous fallback to the default branch - we already
check that the target branch is defined.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1973>
2021-08-24 12:00:38 +02:00
Carlos Garnacho
117027d9fd ci: Add job to check code style
At the moment, allow the task to fail, while we smooth out the
uncrustify configuration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1924>
2021-08-22 21:27:35 +02:00
Florian Müllner
b17f27416d ci: Switch to meson's generated Junit report
... instead of generating it ourselves from the regular meson logs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1957>
2021-08-22 17:32:12 +00:00
Florian Müllner
7eb68b43a9 ci: Use backend-agnostic meson command to build
There's no alternative backend in sight for us, but it's nice to
only deal with a single build tool.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1957>
2021-08-22 17:32:12 +00:00
Jonas Ådahl
23bebf3385 xwayland-grab-keyboard: Switch to g_pattern_spec_match_string()
The g_pattern_match_string() variant is deprecated, switch to the
properly namespaced one.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1941>
2021-08-12 13:11:31 +00:00
Florian Müllner
6c19d39d8b ci: Build settings-desktop-schemas from git
We need a newer version for
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/687.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1938>
2021-07-27 14:17:40 +00:00
Florian Müllner
035527cdcb ci: Move FDO_UPSTREAM_REPO to global scope
ci-fairy also uses the variable to set the upstream remote that is used
to build the commit range to check.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1936>
2021-07-19 15:14:04 +02:00
Florian Müllner
221331a1db ci: Bump ci-templates image
Before building a container image, the code checks that the
repository's container registry is enabled. That check was
broken a while ago, update the image to pull in the fix.

See https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/39

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1935>
2021-07-19 13:40:42 +02:00
Carlos Garnacho
5e8c808cfb ci: Add job for pushing coverity reports
This job does:
1. Download the coverity bundle and untar it
2. Build mutter using clang and the coverity tool
3. Compress the coverity report
4. Upload for analysis

Things to note:
- Analysis are throttled, as per https://scan.coverity.com/faq#frequency
  we qualify for 21 weekly builds, 3 daily. Mutter is sometimes a busy
  project, so it seems we'd get often those consumed early in the day.
  This is something we can resign to, but the times we'll try to upload
  a report to have it rejected make the operation kinda pointless and
  probably better throttled by ourselves.
- The task is manual, given the restrictions above.
- The task only applies on master, as the envvar holding the coverity
  token is protected in gitlab.
- I had to use clang as the coverity tool doesn't seem to work ATM with
  gcc as per recent Fedora.
- The coverity tarball is 1.2GB in size, which is a bit too big to have
  it downloaded each time. As per their upload instructions, the tarball
  gets updated twice yearly, so this is cached to minimize downloads.
- The coverity token for mutter is kept private/hidden in gitlab CI
  settings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1100>
2021-07-13 15:14:21 +00:00
Jonas Ådahl
747dbe2a69 ci: Bump to F34
This drops some custom building of various components that are now up to
date. While at it, start using the FDO_DISTRIBUTION_PACKAGES variable to
install packages, as it with the bumped ci-templates version also
doesn't install weak dependencies.

This also requires tweaking the pipewire dead lock work arounds, as it
changed configuration file paths.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1865>
2021-07-08 13:15:18 +00:00
Jonas Ådahl
3d2d5cd334 ci: Enable native backend and screen cast tests
With the surfaceless mode in the headless backend, it's now possible to
initiate the headless mode without any mode setting devices, or render
nodes, without any special CI runner privileges.

The native backend tests include screen cast tests, so make them
possible to run by starting pipewire. Testing shows that enabling audio
support (pulseaudio & jack compat layers) makes the tests dead lock and
eventually timeout, so disable those features for now.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
2021-03-12 15:09:45 +00:00
Jonas Ådahl
2be09ce045 ci: Run whole run-tests.sh in a D-Bus session
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
2021-03-12 15:09:45 +00:00
Jonas Ådahl
78ba1429c8 tests: Add headless native backend test
It doesn't do anything more than construct and tear down, but it's a
start.

Don't run the test as part of CI yet, as doesn't have the DRM devices
needed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
2021-03-12 15:09:45 +00:00
Florian Müllner
e2a68b5ba1 ci: Update ci-fairy image
Previously the information which commit failed a commit message check
was hidden in parts of the report that don't show up in gitlab's UI.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1753>
2021-03-04 11:13:41 +00:00
Michel Dänzer
91229e824e ci: Drop dependencies: stanzas
Redundant with needs:.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1725>
2021-02-10 09:52:56 +01:00
Georges Basile Stavracas Neto
02610a1d45 build: Bump pipewire dependency
The 0.3.21 release includes busy buffers, which are a requirement
for us to switch to cogl_framebuffer_flush() in the next commit.

Bump pipewire dependency to 0.3.21, and adjust CI to build it from
the corresponding tag.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1701>
2021-02-08 08:37:08 +00:00
Jonas Ådahl
30e1c51b33 Change all g_memdup() to g_memdup2()
Using g_memdup() is dangerous due to the type of the size argument. See
https://gitlab.gnome.org/GNOME/glib/-/issues/2319 and
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1926 for details.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1708>
2021-02-04 19:16:28 +01:00
Jonas Ådahl
e558d6acb9 ci: Install Xwayland from git
This gives us -initfd, thus Xwayland on demand in the CI.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1681>
2021-01-25 15:14:35 +00:00
Carlos Garnacho
5411b892a0 build: Bump gsettings-desktop-schemas dependency
We will depend on new settings there, ensure we build depend on
it, and CI pulls the dependency.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1416>
2021-01-14 13:58:16 +00:00
Florian Müllner
bd15cfc94b ci: Replace custom commit-log script with ci-fairy
ci-fairy now supports checking commit messages for required/disallowed
patterns. Use that to replace our custom commit-log script.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1649>
2021-01-11 14:02:58 +01:00
Michel Dänzer
0a456b4808 ci: Set GIT_STRATEGY: no for some jobs
These jobs don't need the Git tree.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1647>
2020-12-17 15:49:10 +01:00
Jonas Ådahl
5ddf416bc9 ci: Build and test also on aarch64
This adds 64 bit ARM support to parts of the CI pipeline, more
specifically, we now:

  - Build a 64 bit ARM container image alongside the 64 bit x86 one.
  - Build test mutter on 64 bit ARM
  - Run tests on 64 bit ARM
  - Check coverage on 64 bit ARM

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1577>
2020-11-23 17:53:36 +01:00
Jonas Ådahl
aa186193b5 ci: Bump ci-templates to include ci-fairy fix
This should avoid ci-fairy crashing when checking merge requests on the
same repo as the target branch.

See
https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/66.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1587>
2020-11-23 14:27:38 +00:00
Jonas Ådahl
6e27cc0548 ci: Generate junit report if project doesn't enable the registry
The image registry must be enabled for the CI to work, as the container
image from the upstream registry is placed (as a reference, more or
less) in the local registry.

Recently, ci-templates got a bit more helpful if this happened, and will
fail up front and generate a JUnit report with a message describing the
issue.

Update to this version.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1587>
2020-11-23 14:27:38 +00:00
Jonas Ådahl
78f43baa93 ci: Guard pipeline on review stage
The first step is now review, as they use the tiny ci-fairy image, not
our custom ones, so the guards should be on those, not the build step.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1588>
2020-11-20 23:19:49 +00:00
Jonas Ådahl
6b220c9c37 ci: Rename only_default to pipeline_guard
It's the rules that guard the pipelines, deciding when they are allowed
to run or not. The 'only_default' comes from the fact that in the past
they set the only: field.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1588>
2020-11-20 23:19:49 +00:00
Florian Müllner
abd8032fe5 ci: Include gdm in image
gnome-shell depends on gdm's client library at runtime, but the
new pipeline-built image no longer provides it.

Add it back, but built it from source instead of using the Fedora
package, so we don't draw in all of gdm's runtime dependencies
(which includes a full GNOME session including gnome-shell).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1590>
2020-11-20 20:19:50 +01:00
Florian Müllner
bfeec27435 ci: Include development files for accountsservice
... needed to build GDM, which we'll do in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1590>
2020-11-20 20:19:50 +01:00
Jonas Ådahl
ce1e7a5afe ci: Check that allow-collaboration is checked for merge requests
This required for merging to be possible, so make the lack of this check
box being checked a discoverable error.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1586>
2020-11-20 17:44:59 +00:00
Jonas Ådahl
07c64ded78 ci: Use ci-fairy image in review and run first
This image is much smaller than the one with all the build dependencies,
thus will finish much faster.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1586>
2020-11-20 17:44:59 +00:00
Jonas Ådahl
efbb798309 ci: Use non-string like list for "need" relationships
Looks more natural, since it refers to another entity, not an arbitrary
string.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1586>
2020-11-20 17:44:59 +00:00
Florian Müllner
abdf467ad9 ci: Include GTK4
... for https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1495.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1584>
2020-11-20 14:52:26 +01:00
Jonas Ådahl
e4db49d467 ci: Bump ci-templates to include registry path fix
ci-templates had a bug where it failed to find the ready-built container
images on the upstream repository due to invalid assumptions about the
relationship between upstream repository and image registry. This
resulted in the container image to be rebuilt, wasting valuable CPU
cycles and storage space. Bump the included ci-templates template to
include the fix for this.

See https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/22.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1583>
2020-11-20 11:24:46 +01:00
Jordan Petridis
83f5f7728f ci: Set some sensible defaults
* Allow for all jobs to be cancelled if a newer commit is pushed
* Automatically retry jobs if they fail due to some infrastructure issue

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1578>
2020-11-20 07:12:25 +00:00
Jordan Petridis
6f380114be ci: Replace only/except with rules
only/except keywords where deperecated in favor of rules.

Since we started using GNOME/mutter!1525 it introduced
a second pipeline being run for each commit.

Detached pipelines are the only way to access CI_MERGE_REQUEST_*
variables, and if we disable normal pipelines you will need to
create wip/spam MRs in order to run the tests.

This reworked rules makes it so, the normal pipeline needs manual
interaction to be started, and the detached/MR pipleines is always
run.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1578>
2020-11-20 07:12:25 +00:00
Jonas Ådahl
fddd18cdd2 ci: Use ci-templates
This changes from manual container image building using podman locally
to building the container images as part of the CI pipeline.

It uses the CI templates from
https://gitlab.freedesktop.org/freedesktop/ci-templates.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1525>
2020-11-19 13:24:35 +00:00
Jonas Ådahl
a50a5944a7 gitlab-ci.yml: Removed unnecessary when:
It resulted in failed instead of skipped jobs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1567>
2020-11-16 16:28:45 +00:00
Jonas Ådahl
8da1c192e6 ci: Make check-commit-log run again
It needs 'only: merge_request' to get the necessary env variables.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1567>
2020-11-16 16:28:45 +00:00
Jonas Ådahl
815ed52ca1 ci: Wait for review stage before continuing
If review fails, it'll fail very early in the pipeline, but we won't see
the test case failure until the whole pipeline succeeds, which might be
10 minutes later.

To avoid sitting there wondering why it failed, let the time consuming
jobs wait until the review stage, which tends to take less than 20
seconds, succeeds. This way the review test result will be presented
earlier.

This changes the pipeline to run the check-commit-log job also for
non-merge requests, with the difference being that it will pass
immediately if it's not a merge request.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1549>
2020-11-16 14:13:07 +01:00
Jonas Ådahl
0c9f7c7735 ci/check-commit-log: Generate JUnit report
This will make it less horrible when commit message doesn't pass the
compliance checks.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1549>
2020-11-16 14:12:53 +01:00
Carlos Garnacho
232dcad64f ci: Run coverage target by default
We're just a "ninja coverage" away from getting the full report,
it is not that much extra to the pipeline. Also, fix bugs that
accumulated since the manual task was added, e.g. let the full
built+tested tree available on the coverity stage.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1535
2020-10-28 14:07:56 +00:00
Niels De Graef
3bc15ade04 ci: Generate a cover report for the test suite
Based on @ebassi's work from https://gitlab.gnome.org/GNOME/glib/merge_requests/769

This MR allows us to see the succeeded/failed tests each time the CI
pipeline is run.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/528
2020-10-15 10:18:44 +02:00
Florian Müllner
769997b0bc ci: Explicitly specify job dependencies
We can speed up CI a bit by allowing build jobs to run in parallel
with review jobs, and don't have test jobs wait for non-default
build configuration builds.

See https://gitlab.gnome.org/help/ci/yaml/README.md#needs for details.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1398
2020-08-04 18:00:04 +02:00
Marco Trevisan (Treviño)
132060db21 ci: Save built artifacts only for the test build
We only test the meson-build job, so there's no point to save artifacts for
the other test-build only builds.

So, only save meson logs artifacts (with a default gitlab expiration time)
for the other build-without-* jobs

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1236
2020-05-07 22:08:44 +00:00
Marco Trevisan (Treviño)
24a0e72ae9 ci: Remove the MALLOC_PERTURB_ definition
meson already provides one by default [1].

[1] https://github.com/mesonbuild/meson/blob/master/docs/markdown/Unit-tests.md#malloc_perturb_

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1236
2020-05-07 22:08:44 +00:00