Commit graph

107 commits

Author SHA1 Message Date
Jan Vaclav 61f0531509 gitlab-ci: test re-buildability of distribution tarballs
Adds tests for making a distribution tarball, and then attempting to build NM from its contents.
Files have been left out from the distribution in the past by accident (e.g. 75027879, b2931c96)
and hopefully this test will catch this type of errors.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1862
2024-03-01 07:51:21 +00:00
Íñigo Huguet 6a1d81abf7 CI: check for potential translation errors
Some warnings in the generation of the translation files indicate real
errors, like strings that cannot be extracted for translations. Check
that no warnings are emitted.
2023-12-18 15:53:16 +01:00
Thomas Haller 5a6c8c9ba4
gitlab-ci: regenerated gitlab-ci template and fix versions
- after modifying .gitlab-ci, the template must be regenerated by
  running `ci-fairy generate-template`

- when swapping tier1 from f38 to f39, the list in tier2 must be updated
  too.

Fixes: e2f04f0d2cc3 ('device: fix generated 'wifi.cloned-mac-address="stable-ssid"' for stable-id')
2023-12-06 11:33:11 +01:00
Fernando Fernandez Mancera ee551595b4 gitlab-ci: upgrade tier1 to run Fedora 39
As Fedora 39 is officially out, we should use it in our gitlab-ci.
Please notice that this change will also update the
nm-code-format-container.sh to use Fedora 39 aswell.
2023-12-06 10:37:38 +01:00
Thomas Haller 339f99c08e
gitlab-ci: drop builds for CentOS 8 (8.1.1911, 8.2.2004, 8.3.2011)
CentOS Linux 8 is long gone. We were only running tests on this old
build environment, to see how we fare in such environment.

The test was broken for 4+ months. Instead of fixing it, disable it.

It's partly caused by RHEL8, as it is somewhat cumbersome to even build
on CentOS 8. That's because some devel packages (like libteam-devel) are
not installable. As workaround for that, we re-build such packages in a
copr ([1]). The problem is, that we only have one copr build for e.g.
CentOS 8. If we rebuild against latest CentOS 8 Stream, then libteam is
build against newer dependencies, which are not installable on CentOS
Linux 8.1.1911 (etc). We would have to build libteam in a way, that
does not drag newer dependencies that are missing on CentOS Linux 8.

For example, trying to use copr [1] on CentOS Linux 8 and installing
"teamd" gives:

  Error:
   Problem: package teamd-devel-1.31-4.el8.x86_64 requires teamd = 1.31-4.el8, but none of the providers can be installed
    - conflicting requests
    - nothing provides libjansson.so.4(libjansson.so.4)(64bit) needed by teamd-1.31-4.el8.x86_64

This could be hacked around, for example by having libteamd-devel not
depend on any teamd package. Instead, just drop it. It's gone.

Arguable, CentOS 8 Stream should be reasonably close (in terms of
versions of gcc, glibc, glib) so we don't miss too much.

[1] https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1793
2023-11-15 10:52:53 +01:00
Thomas Haller eb5b78c4bf
all: drop support for building with Python2
Now that we no longer test on CentOS7, we also have no more tests that
build using Python2.

Note that build with Python2 is currently broken already (which would be
fixable).

Drop Python2 too.

Existing Python scripts still use a common subset of Python2 and
Python3. They can be improved to use Python3 features in the future.
2023-11-14 10:29:48 +01:00
Thomas Haller c5fd65aba4
gitlab-ci: drop centos:7 tests
CentOS7 uses gcc-4.8, which have various problems and working around
them is getting more cumbersome.

Also, CentOS7 is ancient by now. It's time. Drop it.
2023-11-14 10:29:48 +01:00
Thomas Haller 7871e160ed
gitlab-ci: enable tests on Fedora 40
We don't use "rawhide", because we explicitly enable Fedora versions by
their release number (and "rawhide" is just an alias).

However, by now "rawhide" is Fedora 40. Enable it.
2023-11-14 10:29:48 +01:00
Thomas Haller ccb16013e0
gitlab-ci: fix detection and handling of Ubuntu 18.04
Fixes: d563b4e009 ('gitlab-ci: fix setup of debian:9 container')
2023-06-30 18:51:13 +02:00
Thomas Haller d563b4e009
gitlab-ci: fix setup of debian:9 container
Debian:9 (stretch) is archived. We need to patch the sources.list
for it to be usable.

Although it's end of life, we are still interested, whether we
are able to build with such old compiler. Fix the test.
2023-06-28 12:14:21 +02:00
Thomas Haller fbbe81634f
gitlab-ci: add .gitlab-ci/README.md 2023-06-06 12:35:09 +02:00
Thomas Haller 3707a3df80
gitlab-ci: print the used clang-format version in "check-tree" test
This is the authorative version that we shall use for formatting our code.
Print the version in the test.
2023-06-01 09:24:21 +02:00
Thomas Haller 70084f2485
gitlab-ci: update ci-templates to fix installation of debian:9 containers
Debian 9 (stretch) is end of life, and the repositories are archived. We
need to patch the containers so that `apt-get update` continues to work.
A new ci-templates version brings that.

Note that at the moment, there is still another issue for debian:9
containers. Unclear whether that can be fixed. In any case, bumping to
latest ci-templates is not wrong, and works around the first issue on
debian:9, making it possible to at least look at the second issue.

https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/175
2023-05-31 22:14:23 +02:00
Thomas Haller c80076c501
gitlab-ci: add CentOS Stream 8+9 containers 2023-05-22 14:47:54 +02:00
Thomas Haller 436b9cb005
gitlab-ci: improve "fedora-install.sh" for CentOS Stream 2023-05-22 14:47:42 +02:00
Thomas Haller ea39d75f7b
gitlab-ci: update default Fedora image for building pages and check steps
We want to follow current Fedora, so update to Fedora 38.

Also, we now use clang-format from Fedora 38 release, so the default
image in gitlab-ci must match, because that image is used for the
"check-tree" test.

While at it, add Fedora 39 and move Fedora 36 to tier 3.
2023-05-19 12:49:24 +02:00
Thomas Haller d9df884fce
gitlab-ci: update to latest ci-templates version 2023-05-19 12:49:23 +02:00
Thomas Haller 89edca4628
gitlab-ci: remove container cleanup stages
These stages were not properly implemented and don't seem to work.
Drop them.

Note that we do want that our cached containers get collected eventually.
As these are just caches for performance reasons, that could be done with
little downsides (we can just regenerate the containers when we need them).
However, that's not done by our gitlab-ci stages. Instead, it should
be done on a project level. It's not clear whether that is actually done,
but if there is a need (because of the resources that this wastes), then
we should do that (on freedesktop.org's gitlab instance).
2023-05-09 09:53:43 +02:00
Thomas Haller 7fa72645e5
gitlab-ci: make detached MR pipeline for external contributor's pipelines to run
The permissions for running CI will be restricted to external
contributors. It will only work for projects that use "detached MR
pipelines" ([1]).

Note that for it to actually work, a member with permission might have
to go to the "pipeline" tab of the merge request and click "run
pipeline". But this snippet is necessary for that.

[1] https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html

https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
2023-04-13 15:19:23 +02:00
Thomas Haller 5475f57d39
gitlab-ci: make tier tests automatic to simplify starting them manually
We want that the tier2+ tests are only run manually. As those tests
depend on the respective prep step, there are 3 possibilities:

1) make prep manual and the tier test automatic. That is what we would
   want, because then we can just manually trigger the prep step (one
   click). However, in the past this didn't work.

2) make the prep automatic and the test manual. That works, the downside
   is that we often run the prep step when its not needed. This is what
   we used to do to workaround 1).

3) make prep and the test manual. Then there are no unnecessary tests
   run, but triggering a manual test is cumbersome. First click to start
   the prep step, then wait, then click again.

Revisit this. It seems 1) is working now. Yeay.

Also rename the prep stages, so that it's clear to which tier they
belong. I guess, I could move them instead to prep1, prep2, prep3
stages, but then there are a lot of columns on the web site.
2023-04-13 09:30:14 +02:00
Thomas Haller afe098a928
gitlab-ci: extract base_type for distros to reduce redundant information
The distro.name is not just a pretty name, its the name under which we fetch
the container. It is thus a well-known name, that we can rely on.

The "base_type" only depends on the distro name, and it makes no sense
to ever choose a different name. Tracking it in the "distributions"
array is thus redundant.

Move the mapping of distro.name to the base type to a separate place.
2023-04-13 09:10:59 +02:00
Thomas Haller 8e37037e88
gitlab-ci: drop "tag"/"default_tag" from ci templates
The tag we actually use already contains a hash of the input files and
is generated (by `ci-fairy generate-templates`). There is no need for having
this fixed prefix. As also seens by having a date there, which is maintained
badly and meaningless.

Drop it.
2023-04-13 09:10:59 +02:00
Thomas Haller 31c05da92c
gitlab-ci: rename "@container-prep" tests to "@prep"
The long name looks verbose and takes away space on the web page.
Shorten the name.
2023-04-13 09:10:59 +02:00
Thomas Haller e41fe546f7
gitlab-ci: use parallel:matrix for tier1 tests
The benefit is that instead of one long running job for fedora:37 (the
current tier1 test), we have several smaller.

A minor downside is, that if the build is broken, then usually the very
first test would already fail. Previously, that meant that the follow up
tests were skipped. Now, they run all in parallel. However, test
failures should be the exception, so the wasted resources are probably
irrelevant. The upside is, that we can see which tests fail, and we run
them much faster (in parallel).

This is only done for the tier1 test, because those tests are started
automatically. Other tiers need to be triggered manually, which already
means a lot of clicking. Making those also matrix tests, would result in
an insane amount of clicking. As those other tests are run much more
seldom, having them huge is probably fine.
2023-04-13 09:08:04 +02:00
Thomas Haller b06ddab9d4
gitlab-ci: add multiple stages/tiers for tests
We have many test configurations (i.e. distros like fedora:37,
debian:9).  Almost all of them run manually triggered, because running
them every time would be wasteful.

Still, even as we trigger those tests only seldom, whenever we trigger
them all together, they consume still too many resources of the
freedesktop.org gitlab infrastructure.

One possibility would be to just drop old distros (e.g. fedora:30).
Which tests are setup in gitlab-ci is constantly refined and adjusted.
So dropping some distros is not necessarily wrong and bound to happen
eventually.

However, I also don't find it great to just disable tests that are still
passing. If we want to avoid consuming too many resources, we can just
choose not to run those tests. We don't need to enforce that by deleting
tests. Once deleted, such a configuration cannot be tested anymore as it
would be too cumbersome to recreate the setup manually.

Instead, introduce stages/tiers to clearer mark configuration that we
should test even less frequently.

Note that it is still required from the developer to not trigger too
many tests at once, to not monopolize the CI resources. The stages
should make that clearer to see, but don't solve it. Deleting tests
might solve it, but only if we delete a significant number of those
tests, which seems not desirable.
2023-04-13 09:08:03 +02:00
Thomas Haller d39fb6f014
gitlab-ci: use clearer names for NM_TEST_SELECT_RUN in "run-test.sh" 2023-04-13 09:08:03 +02:00
Thomas Haller 8da0f9f79d
gitlab-ci: assert that NM_TEST_SELECT_RUN is valid in "run-test.sh"
The script now fails, if the user passes an invalid "$NM_TEST_SELECT_RUN"
or if the script references an invalid name.
2023-04-13 09:08:03 +02:00
Peter Hutterer aa74fec602
gitlab-ci: pass --break-system-packages to pip3 for the meson install
pip on Debian 12 semi-forces us to use a venv. That's hard enough but
even more so when we just want to run meson which only relies on the
standard library anyway.

Since that flag doesn't exist on earlier versions, try both and hope one
invocation succeeds.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1595
2023-04-11 13:49:57 +02:00
Thomas Haller 67da2b8e42
gitlab-ci: fix test script to abort on failing first test
Fixes: 89cfd34ae0 ('gitlab-ci: extend run-test.sh script to manually select certain build steps to run')
2023-01-30 08:18:45 +01:00
Fernando Fernandez Mancera 74f66ee276
gitlab-ci: fix CentOS Linux 9 containers during ".gitlab-ci/fedora-install.sh"
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1511
2023-01-24 08:17:44 +01:00
Thomas Haller 01730f5943
gitlab-ci: set OMP_NUM_THREADS=1 to avoid libgomp crash for msgmerge
It's not clear why this happens. But since recently in our gitlab-ci,
all the Fedora machines will fail. It happens in the step

  check_run_clean 6 && test $IS_FEDORA = 1 -o $IS_CENTOS = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson

which explains why it only affects Fedora configurations.

It does not always fail, but the probability of failure is high.
The failure is:

  ...
  rm -f et.gmo && /usr/bin/msgmerge --for-msgfmt -o et.1po et.po NetworkManager.pot && /usr/bin/msgfmt -c --statistics --verbose -o et.gmo et.1po && rm -f et.1po
  libgomp: Thread creation failed: Resource temporarily unavailable
  make[3]: *** [Makefile:383: et.gmo] Error 1

Maybe some new resource restricting in gitlab. Let's add this workaround.
I don't really understand the cause, but this seems to avoid it, which is
good enough for me.
2023-01-19 19:31:28 +01:00
Thomas Haller 1e883ab6e6
gitlab-ci: avoid clean step in "run-test.sh" for manual invocation
When we run `NM_TEST_SELECT_RUN=x ./.gitlab-ci/run-test.sh` to run one
step only, we should not do the final clean, so that the build artifacts
are preserved.
2023-01-19 15:04:46 +01:00
Thomas Haller 8ece80390d
gitlab-ci: bump ci-templates tag to generate new container images 2023-01-18 19:38:49 +01:00
Thomas Haller 81c1168a2d
gitlab-ci: add comment about how to regenerate ".gitlab-ci.yml" 2022-11-29 08:31:38 +01:00
Thomas Haller 89cfd34ae0
gitlab-ci: extend run-test.sh script to manually select certain build steps to run
When the test in gitlab-ci fails, you might want to rerun the test
on your machine. You fire up podman, run "./.gitlab-ci/*-install.sh"
and "./.gitlab-ci/run-test.sh".

Make it possible to manually select parts that are tested by
"run-test.sh" by setting NM_TEST_SELECT_RUN. Otherwise, if you want to
test a particular configuration, you either have to run all earlier
steps (which takes a long time and can even be broken) or you have
to manually patch the file.

For example,

  NM_TEST_SELECT_RUN=6 ./.gitlab-ci/run-test.sh
2022-11-23 16:51:54 +01:00
Thomas Haller 941f998792
gitlab-ci: update default Fedora image for building pages and check steps
We want to follow current Fedora, so update to f37.

Also, we now use clang-format from Fedora 37 release, so the default
image in gitlab-ci must match, because that image is used for the
"check-tree" test.
2022-11-23 09:18:43 +01:00
Thomas Haller 1106146bfd
gitlab-ci: update to latest ci-templates version 2022-11-23 09:17:55 +01:00
Thomas Haller 2d0170ca7c
gitlab-ci: update ci-templates version 2022-10-11 09:47:39 +02:00
Thomas Haller dc2cbe1858
gitlab-ci: enable F38 container and regenerate containers 2022-10-11 09:47:39 +02:00
Thomas Haller 7ee0da3eaf
build: don't "update-po" during make dist
Instead, hack gettext's Makefile.

gettext has an issue with parallel make. See [1] and [2].
Reproduce with:

  git reset --hard &&
    git clean -fdx &&
    NOCONFIGURE=yes ./autogen.sh &&
    ./configure --enable-gtk-doc --enable-introspection &&
    make -j distcheck V=1

We worked around this by setting "DIST_DEPENDS_ON_UPDATE_PO = yes",
however that (obviously) results in regenerating source files during
dist. "Source files" in the sense that the po files are commited to git
and get distributed in the release. Doing this is very ugly.

In particular it's ugly, because `make -C po update-po` is not reproducible
and the output depends on the current time (*had one job*).
Otherwise, we could just regenerate the files before doing a release.

This means, running "release.sh" script ends up with a dirty tree
afterwards. Also, the distributed po files are not the ones from the source
tree when we did the release. Also, since "release.sh rc1" does two distributions
(once for the rc1 and once for the next devel snapshot), the commit for the
second distribution will have a large diff for the po files.

This reverts commit 978d8eb699 ('po: make dist depend on update-po')
and hacks around the problem.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094#note_1435313
[2] https://lists.gnu.org/archive/html/bug-gettext/2022-06/msg00022.html

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1405
2022-10-03 17:50:09 +02:00
Thomas Haller 991481a568
gitlab: fail if "run-test.sh" with dirty working tree 2022-10-03 17:50:03 +02:00
Thomas Haller 7eaec52899
gitlab-ci: fix preserving build artifacts and documentation pages
Without it, the build artifacts were deleted before getting archived.
It means, the tarball and the docs were no longer archived and no
pages on gitlab no longer updated.

Fixes: e118276296 ('gitlab-ci: run unit tests for git subtree subprojects')
(cherry picked from commit cfe44c8832)
2022-08-24 20:57:51 +02:00
Thomas Haller bde99436aa
gitlab-ci: print git-status during do_clean() in "run-test.sh"
If we have a non-clean working directory after do_clean(), that
is a bug and something we need to investigate. Print information
to make that easier to debug.
2022-07-25 10:27:40 +02:00
Thomas Haller e118276296
gitlab-ci: run unit tests for git subtree subprojects 2022-07-25 10:27:40 +02:00
Thomas Haller b12281089c
gitlab-ci: fix unit tests on centos7 for python-pexpect dependency
Fixes: 9570224e86 ('tests/client: add a pexpect-based test runner')
2022-07-06 18:36:52 +02:00
Thomas Haller d8a4b3bec2
all: reformat with clang-format (clang-tools-extra-14.0.0-1.fc36) and update gitlab-ci to f36 2022-07-06 11:06:53 +02:00
Lubomir Rintel 28a53403d1 ci: trivial changes to comments
Hopefully for better not worse.
2022-06-27 13:40:09 +02:00
Lubomir Rintel 9fdb6bea44 ci: drop Ubuntu 16.04
It's sad, old and unsupported. Also its gettext is old and smells of
elderberries.
2022-06-27 13:40:09 +02:00
Lubomir Rintel 978d8eb699 po: make dist depend on update-po
This works around a race condition with gettext Makefile.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094#note_1435313
2022-06-27 13:40:09 +02:00
Lubomir Rintel 16a7c1acab gitlab-ci: regenerate images 2022-06-27 09:10:44 +02:00