Commit graph

81 commits

Author SHA1 Message Date
Thomas Haller 5ad119391a
gitlab-ci: fix regenerating .gitlab-ci.yml
Fixes: 414d2c1d4b ('contrib,gitlab-ci: fix "contrib/fedora/REQUIRED_PACKAGES" to install "vala"')
2021-08-30 23:20:16 +02:00
Thomas Haller ccd398caf7
gitlab-ci: temporarily disable Fedora 35 and 36
It fails to install the container. Disable it, until it is more
stable.

    ...
    Install  363 Packages
    Total download size: 275 M
    Installed size: 1.1 G
    Downloading Packages:
    python3: allocatestack.c:191: advise_stack_range: Assertion `freesize < size' failed.
    ./contrib/fedora/REQUIRED_PACKAGES: line 17:   815 Aborted                 $NM_INSTALL "$@"
    subprocess exited with status 134
    subprocess exited with status 134
    exit status 134
2021-08-30 13:14:00 +02:00
Thomas Haller 203b6fb194
gitlab-ci: update which distros to build 2021-08-30 13:14:00 +02:00
Thomas Haller 53562b1915
contrib: remove "vala-tools" from "contrib/fedora/REQUIRED_PACKAGES"
Since Fedora 25, vala-tools was merged with "vala" package. And on
rawhide (f36) it's gone completely and leads to a failure of the script.

Drop it.
2021-08-30 11:39:01 +02:00
Thomas Haller cf1b726157
gitlab-ci: regenerate ci-templates's containers 2021-07-21 10:11:55 +02:00
Thomas Haller 8dddb7544f
gitlab-ci: regenerate ci-templates's containers 2021-07-12 17:38:49 +02:00
Thomas Haller aba1754a80
gitlab-ci: bump tag for cached container images
This results in a rebuild of the containers, which is a good idea as we
didn't do that for a while.
2021-06-23 21:02:49 +02:00
Thomas Haller fb64935597
gitlab-ci: fix error evaluating "distro.always" in ci.template
...
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1361, in generate
    yield self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File ".gitlab-ci/ci.template", line 178, in top-level template code
    {% if not version in distro.always and (distro.name != pages_build.name or version != pages_build.version) %}
  jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'always'
2021-05-26 22:39:33 +02:00
Thomas Haller 7e581a0303
Revert "contrib: no longer install libuuid as build dependency"
Ups, we actually still require libuuid. Actually, we only need to
to build the example script `examples/C/glib/add-connection-gdbus.c`.
The proper solution would be to make this an optional dependency.

So far this was not yet done. Also, libuuid is really an ubiquitous
dependency on Linux, so it's not really a problem to have this build
dependency, even if it's just to build the examples.

This reverts commit c0a3947ff9.
2021-05-26 22:16:35 +02:00
Thomas Haller 4e7040d46d
gitlab-ci: belatedly regenerate .gitlab-ci.yml 2021-05-26 21:45:51 +02:00
Thomas Haller 901f0bdeb3
gitlab-ci: fix running Fedora 34 test by default
- the container that is also "pages_build" should always
  run automatically. This can replace the "always" tag.

- comment out the "always: 33" part, because we no longer need
  it. It was also wrong, because by now we should run Fedora 34
  automatically.
2021-05-04 15:42:26 +02:00
Thomas Haller ebde0a3506
gitlab: update pages build to use Fedora 34 container 2021-05-04 13:56:28 +02:00
Thomas Haller b32dc4f2cf
gitlab: add Fedora 34 container for CI pipeline 2021-05-04 13:56:25 +02:00
Thomas Haller 94ba38962f
contrib: install clang-format via REQUIRED_PACKAGES
On Fedora 33, we get it automatically because "clang" package
has an indirect (weak) dependency for clang-tools-extra. On
Fedora 34, that is no loger the case.

We need to explicitly install it.
2021-05-04 13:56:19 +02:00
Thomas Haller 371b64bd70
gilab-ci: update .gitlab-ci.yml to use "main" branch name 2021-04-01 21:43:01 +02:00
Thomas Haller 7e32c3efda
gitlab-ci: generate new container images for tests
- the python-black version on Fedora 33 was updated, and this formats
  our python code differently. The black version that is used by our
  gitlab-ci is the authoritative version that should be used. Update
  it by regenerating the containers.

- especially Fedora:rawhide and Debian:sid often introduce changes that
  will cause a break of our build. Update the containers to test latest
  versions.
2021-01-28 14:50:39 +01:00
Thomas Haller 81e0837678
gitlab-ci: install missing packages on Alpine Linux
The "contrib/alpine/REQUIRED_PACKAGES" script is also
used by gitlab-ci to setup the test container. These
packages are required for unit tests.
2020-12-23 10:48:26 +01:00
Thomas Haller a1002bd93a
gitlab-ci: enable test build on alpine linux
Alpine is especially interesting because it uses musl as libc.

The build does not yet succeed. There are several issues that
need to be fixed.

However, it will be simpler to fix things, if we have tests
in place -- even if at the moment they are known to be broken.

See-also: https://git.alpinelinux.org/aports/tree/community/networkmanager?h=master
2020-12-11 18:14:10 +01:00
Thomas Haller a6e234349c
gitlab-ci: update used "ci-templates" version 2020-12-11 18:14:10 +01:00
Thomas Haller 4ce62b6df3
gitlab-ci: fix failure to enable PowerTools on CentOS8 build
Seems that the repository was renamed (or can sometimes have
a different name). Try both the "PowerTools" and "powertools" name.
2020-12-11 18:06:52 +01:00
Thomas Haller d07cd5dbf2
all: avoid GNU "which" from shell scripts
"which" is a separate package and may not be installed.
Also, shell has a built-in command for the same purpose.
Use that.
2020-12-11 16:42:23 +01:00
Thomas Haller 9960c8d727
gitlab-ci: add CentOS 7.9 and 8.2 images 2020-11-24 18:44:11 +01:00
Peter Hutterer 133de4ab59
gitlab CI: remove leftover comments referring to libinput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/684
2020-11-18 08:36:13 +01:00
Thomas Haller 0e7e88cfc7
gitlab-ci: combine ubuntu/centos install scripts with their debian/fedora counterparts
Ubuntu/Debian and CentOS/Fedora are sufficiently similar that it's
better that we have only one variant of ".gitlab-ci/*-install.sh"
and "contrib/*/REQUIRED_PACKAGES".

This was already the case, however, we used to symlink
".gitlab-ci/centos-install.sh" to "fedora-install.sh". That
worked, but it didn't scale very well. For example, if we would follow
that pattern, we would also need a symlink "contrib/centos/REQUIRED_PACKAGES"
Or should "contrib/centos" symlink to "contrib/fedora"? That seems even
more wrong.

We already had the "distro.base_type" variable for that. Make use of
that also for the install script.
2020-11-17 13:28:18 +01:00
Thomas Haller f1ff6fe8b7
gitlab-ci: install correct version of ci-templates in build script
It's not clear that ci-fairy has a stable API. Instead, we pin the
version by specifying the git commit sha.

In the build script, install the pinned version.
2020-11-17 09:48:48 +01:00
Thomas Haller 539c00a8a1
gitlab-ci: automatically hash build scripts into tag for ci-templates container
ci-templates builds and caches the test containers. When the build
scripts, the ci-template or "config.yml" changes, we need to bump
the tag so that the containers get rebuild.

Partly automate this. The tag now gets generated by the template and
contains a checksum of certain build files. Thus, if you change
any build files, then `ci-fairy generate-template` would generate a
different tag. You can not miss that, because we have tests that ensure
that our ".gitlab-ci.yml" is up to date. Also, you no longer need to
manually bump the tag when a build script changes, just regenerate
".gitlab-ci.yml" with `ci-fairy generate-template`.

See also: https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/54
2020-11-17 09:40:35 +01:00
Thomas Haller 8df0dee3e8
gitlab-ci: automatically run prep-container to fix hanging tests
The goal is to run most distros only manually. However, it would be nice
to avoid (manually) clicking twice to start the tests for one distro:
once for the container preparation, and once for the actual test.

Previously, the container prep part was set to manual and the actual
test automatic. It worked almost as desired, except that this leads
to the entire gitlab-ci pipeline be be in running state indefinitely.

To fix that, always run the container prep steps. If the container is
cached, this is supposed to be fast and cheap. Now only the actual tests
are marked as "manual".
2020-11-11 08:50:17 +01:00
Thomas Haller 767c83f443
gitlab-ci: add "needs" for pages test
It seems "pages" test does not get properly triggered, if only
t_fedora:33 completes. It should, because the other distros are
optional. Try to set "needs" to fix that.
2020-11-11 08:47:16 +01:00
Thomas Haller b96d48efca
gitlab-ci: fix building artifacts (pages) during gitlab-ci test 2020-11-10 19:43:55 +01:00
Thomas Haller 9ebf5f938c
gitlab-ci: bump default-tag 2020-11-10 13:51:29 +01:00
Thomas Haller 7fa122394c
gitlab-ci: merge "check-ci-script" test with static checks
Certain parts of the code are entirely generated or must follow
a certain format that can be enforced by a tool. These invariants
must never fail:

  - ci-fairy generate-template (check-ci-script)
  - black python formatting
  - clang-format C formatting
  - msgfmt -vs

On the other hand, we also have a checkpatch script that checks
the current patch for common errors. These are heuristics and
only depend on the current patch (contrary to the previous type
that depend on the entire source tree).

Refactor the gitlab-ci tests:

- split "checkpatch" into "check-patch" and "check-tree".

- merge the "check-ci-script" test into "check-tree".
2020-11-10 13:51:29 +01:00
Thomas Haller aab7cf2065
gitlab-ci: don't explicitly install black/clang/gettext during checkpatch stage
"checkpatch" is based on the default image (currently fedora:33). It
already has these dependencies installed.
2020-11-09 10:53:55 +01:00
Thomas Haller f19f3f74c6
gitlab-ci: add ubuntu:20.04 test and reorder versions 2020-11-09 10:48:05 +01:00
Thomas Haller cfc7688ec2
gitlab-ci: let Fedora 33 test always run
That is now the one that generates the pages and runs checkpatch stage.
2020-11-09 10:46:19 +01:00
Thomas Haller b780f9315c
gitlab-ci: generate pages on Fedora 33 image
On one image we do extra work, like generating documentation (gitlab-pages).
The same image is currently also used for the "checkpatch" step. That step
checks code formatting using clang-format. The formatting depends on the
clang version, and we currently choose Fedora 33 as the desired version
for formatting.

It means, the "checkpatch" step requires Fedora 33. We could choose a
different image for generating pages and run check patch. However, that
might not be best. Just also generate the pages using Fedora 33.
2020-11-09 10:34:19 +01:00
Thomas Haller 52c6891534
gitlab-ci: reorder jobs for checkpatch test
All the steps of "checkpatch" test (except the last) check
the current tree for consistency. Those checks must always
pass.

Only the last step calls the "checkpatch-feature-branch.sh".
That script checks for common patterns, like avoiding g_assert()
(in favor of other assertion types). That last check only checks
the current patch, and there are many cases where the test is
known to fail (because these are just heuristics). As such, the
step that may fail should be called as last.
2020-11-09 09:35:59 +01:00
Peter Hutterer 35334f478b
gitlab CI: switch to using ci-templates
ci-templates encourages building specific containers that can be re-used:
- containers are re-used across pipelines, producing consistent results
- containers are re-used by contributors since they will use the upstream
  containers for their MR, thus guaranteeing the same results.

Containers are automatically rebuild whenever the respective
FDO_DISTRIBUTION_TAG changes. This is particularly interesting now that
Docker Hub will introduce pull limits.

This CI script consists of a config file and a jinja2 template, simply
running 'ci-fairy generate-template' produces the .gitlab-ci.yml.
ci-fairy is part of the freedesktop.org ci-templates and can be pip
installed, see the check-ci-script job.

Functional changes to the previous script:
- new job: check-ci-script, verifies that our gitlab-ci.yml is the one
  generated by the sources
- Added distributions:
  - Fedora 33
- The actual work is now down by a set of scripts in .gitlab-ci/,
  specifically:
  - .gitlab-ci/build.sh is the previous do_build job
  - .gitlab-ci/{fedora|debian}-install.sh are the previous {fedora|debian}_install jobs
  symlinks are in place for centos and ubuntu

Why the scripts instead of steps in the CI? Easer to reading and
reproduce. With the containers being static, it's easy to pull one
locally and re-run the CI job to reproduce an issue. Having everything in a
single script makes that trivial.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/664
2020-11-09 09:28:11 +01:00
Thomas Haller e8f72a2e4b
gitlab-ci: combine tests for checkpatch/black/msgfmt and nm-code-format.sh
There is no need spawn up two containers (and install similar packages, doing so is
resource intensive), to run two different tests. We can run them in the same
container.

At this point Fedora 33 is not yet fully released. But it will happen soon, so the
image is stable enough for these kinds of tests (and will only get more
stable in the following weeks).

Also no longer collect an artifact with the test output. The test output
is already nicely visible in the gitlab-ci UI. No need to collect it
separately.
2020-09-29 09:46:02 +02:00
Antonio Cardace faa8053802
gitlab-ci: add clang-format test on fedora 33 which run clang-format 11
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-28 15:08:41 +02:00
Thomas Haller a4f99bab1d
gitlab-ci: add test for checking po files 2020-09-04 10:11:41 +02:00
Thomas Haller 12e8557476
gitlab-ci: fix workarounds for Ubuntu 16.04 in tests
The detection for Ubuntu 16.04 was broken. By now /etc/os-release
contains

    VERSION="16.04.7 LTS (Xenial Xerus)"
2020-08-28 14:24:32 +02:00
Thomas Haller e1e1241aae
gitlab-ci: enable fedora:33 build and generate pages on F32 2020-08-18 23:31:50 +02:00
Thomas Haller 9fa59c156b
gitlab-ci: check "examples/python/gi/nm-wg-set" with black 2020-07-02 17:44:29 +02:00
Thomas Haller 8c3ee4e857
gitlab-ci: enable python black check in gitlab-ci 2020-06-19 12:58:52 +02:00
Thomas Haller 70f3ad6785
gitlab-ci: run checkpatch test against fedora:32 target 2020-06-19 12:47:15 +02:00
Thomas Haller 49886cedd9
gitlab-ci: avoid signing release build in gitlab-ci
The environment has no GPG key configured, so trying to sign fails.
2020-06-07 15:26:03 +02:00
Thomas Haller 0a030da6c2
gitlab-ci: add more CentOS images for tests 2020-05-14 12:03:24 +02:00
Thomas Haller 5feba97cd1 gitlab-ci: use old meson version on Ubuntu 16.04 to work with ninja-1.5.1
Meson 0.54.0 requires ninja-1.7 ([1]).

On Ubuntu 16.04, we now would get meson 0.54.0 via pip3, but ninja-1.5.1 via
apt. That doesn't work anymore.

We could install ninja via pip3, but of course, doing that on other
Debian/Ubuntu versions fails due to ... I don't even want to know.

So, instead use an old meson version on Ubuntu 16.04, which is
known to still work with the ninja provided by the packaging system.

We anyway don't want to test the same meson/ninja versions on all our
Ubuntu/Debian images. The point of having different images is to build
with different software versions. If `pip3 install` gives us the same
everywhere, it isn't very useful.

https://mesonbuild.com/Release-notes-for-0-54-0.html#ninja-version-requirement-bumped-to-17
2020-04-02 09:54:26 +02:00
Thomas Haller 571786c211 gitlab-ci: set DEBIAN_FRONTEND=noninteractive for apt-get install
Otherwise, installing a package might prompt for the user to type something,
breaking the CI build.
2020-04-02 08:12:36 +02:00
Antonio Cardace 17082a868e gitlab-ci: use ruby:2.7 for triage pipeline
This fixes the pipeline as 'gem' will be installed by default in the
container image.

Also fix wording and run gitlab-triage in debug mode to get more output.
2020-03-18 17:40:59 +01:00