Commit Graph

131 Commits

Author SHA1 Message Date
Philip Withnall
a9b68f1f9b ci: Update Coverity image to Fedora 34 and latest Coverity Scan tool
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-18 10:32:08 +00:00
Philip Withnall
20b6bda9a2 ci: Update the Fedora CI image to Fedora 34
This is the oldest still-supported version of Fedora.

It no longer ships gamin.

This should fix the installed-tests, which rely on version 0.19 of
python-dbusmock. Fedora 33 only had 0.18.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-08 13:07:57 +00:00
Philip Withnall
5d40604fa7 ci: Drop Android API 21 build jobs
API version 21 was used for Android 5.0
(https://developer.android.com/studio/releases/platforms#5.0), which is
no longer supported
(https://en.wikipedia.org/wiki/Android_version_history).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-20 14:16:11 +00:00
Philip Withnall
c540c6a80e ci: Add link to Coverage output at end of coverage job
This should make it a bit easier to find the coverage report, rather
than digging through the job artifacts.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-01 11:08:22 +00:00
Loïc Le Page
097cd3a16b Add Windows native static build using msvc to CI 2022-01-26 12:07:46 +01:00
Philip Withnall
93bde24c34 ci: Upgrade to clang-format-11 from clang-format-7
`clang-format-11` is now what’s available in our Debian Stable CI image.

This should fix failures in the `style-check-diff` job.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-23 13:13:56 +00:00
Philip Withnall
f432ebf7d5 ci: Add -fstack-protector to mingw64 cross file
See the comment in the code. As suggested by Nirbheek:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2287#note_1285058.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-13 10:44:23 +01:00
Philip Withnall
59832abb69 ci: Use the new CI images
Built using the changes from the last few commits.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 17:15:13 +01:00
Philip Withnall
46588698e2 build: Bump Meson dependency to 0.52.0
This is what’s available in the new Debian Stable, so we can expect it
to be available pretty much everywhere.

Subsequent commits will clean up old workarounds.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 17:15:13 +01:00
Philip Withnall
e728278f83 ci: Install the correct libpcre library in the Debian CI
The package naming is confusing. It turns out we’ve been installing the
wrong libpcre version for ages, but haven’t noticed because the correct
version has previously been installed on the system by default.

It seems that Debian Bullseye doesn’t have the old libpcre installed by
default, so now we have to fix this package name and make sure it’s
installed in the CI images. Building it as a subproject is a pain.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 17:08:35 +01:00
Philip Withnall
e988220f2d ci: Update Coverity download URI
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 17:08:35 +01:00
Philip Withnall
1bba03672e ci: Update Fedora CI images to new oldstable (33)
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 16:29:31 +01:00
Philip Withnall
0aff931ed3 ci: Update Debian CI image to new Stable (Bullseye)
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 16:28:46 +01:00
Philip Withnall
1602ca1d3e ci: Update Android and mingw CI images
Fedora 29 is no longer available, and I need to rebuild these images so
libpcre is pre-downloaded as a subproject.

Update them to Fedora 31, which is what we use in `fedora.Dockerfile`.
This should allow some blobs to be shared in the container repository.

This isn’t the latest Fedora release, but I don’t want to go through the
hassle of updating all the CI images to F33 right now in addition to
updating the subproject caches.

`python-unversioned-command` is needed because the Android NDK calls
`python` without a version number. F29 must have installed this already.
The Android NDK setup appears to be OK with Python 3.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #962
2021-06-16 16:45:10 +01:00
Philip Withnall
24e459e3d8 Rename the master branch to main
It’s a more inclusive name, has the same tab-completion prefix, and is
the default choice for new repositories created locally by git, and on
GitHub and GitLab.

https://sfconservancy.org/news/2020/jun/23/gitbranchname/

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2348
2021-06-07 14:03:48 +01:00
Philip Withnall
1a43d950b4 docs: Update various external links to use HEAD instead of master
Update several links to allow the remote to use its configured default
branch name, rather than specifying `master` as the default branch name.
This will help avoid breakage if any of these projects rename their
default branch in the future.

Fix a few of the links where they were hitting redirects or had moved.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2348
2021-06-07 14:03:48 +01:00
Philip Withnall
ef41cc28b4 ci: Ensure the machine-id is set on the Fedora CI image
Run `systemd-machine-id-setup` when creating the image, so that
`/etc/machine-id` is created with a valid ID. Since systemd isn’t
started when running the CI image with podman/Docker, it’s not created
otherwise. This causes some tests to fail.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-01 13:55:03 +00:00
Philip Withnall
da50de9b30 ci: Include details of machine ID in CI output
Include the size of the `machine-id` file, but not the value itself as
that is sensitive for non-throwaway machines. What’s most useful for
debugging CI problems is knowing whether, and where, the `machine-id` is
set.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-01 13:54:09 +00:00
Frederic Martinsons
81e2fff49c Check if the remote already exists before adding it.
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-01-27 09:13:11 +01:00
Philip Withnall
602528d256 ci: Fix msys-mingw32 CI builds due to package rename
Fix by Christoph Reiter, see
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1879#note_1009843.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-01-19 09:00:54 +00:00
Frederic Martinsons
bbe47331a5 It seems the gitlab CI performs only a shallow clone of 1-depth
and so checkout only the HEAD of the branch.
This leads to not being able to find an ancestor since there is only one
new commit. I presume that when it worked, it was because of specific
settings of some users.

Now we fetch (with the same depth as the target branch) the source branch
and use it to compare sha1 and find the common ancestor.

Closes #2292

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-01-11 17:04:52 +01:00
Frederic Martinsons
c2e21a8164 Move common code for searching common ancestor in a dedicated script
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-01-11 17:04:01 +01:00
Philip Withnall
39f33412db python: Reformat some files to keep style-check-diff happy
The version of `black` on the CI server wanted these changes. Make them
to keep the `style-check-diff` CI job from constantly failing.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-12 18:40:57 +00:00
Sebastian Dröge
fa8a39c6c6 Merge branch 'py-fixes' into 'master'
Python formatting improvements

See merge request GNOME/glib!1757
2020-11-20 18:10:40 +00:00
Philip Withnall
51651ac67e ci: Fix backslash escaping in run-docker.sh
Spotted by shellcheck (warning SC1117): `\e` is not an actual escape
sequence, so it’s interpreted as `\\e`. Best make that explicit.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-20 14:48:14 +00:00
Philip Withnall
d270b6c3db py: Various flake8 cleanups
None of these are particularly significant, but they do get the CI
output clean.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Philip Withnall
e187d836ad ci: Disable formatting warnings in flake8
We use `black` to handle formatting of Python code.

From https://stackoverflow.com/questions/59241007/flake8-disable-all-formatting-rules

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Philip Withnall
905b22a17e py: Reformat all Python files consistently
This commit is the unmodified results of running
```
black $(git ls-files '*.py')
```
with black version 19.10b0. See #2046.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Frederic Martinsons
e817a049f0 Correct shellcheck errors (and ignore world splitting when we want it)
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-15 17:34:27 +01:00
Frederic Martinsons
8f45fbdadd add 2 new stages: sh-check (which run shellcheck) and py-check (which run black and flake8)
The debian docker have been modified to install these tools.

Closes #2046

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-11-15 17:34:21 +01:00
Christoph Reiter
7d1e782c65 CI: Re-enable code coverage reporting for MSYS2 builds
It was disabled in !875 because lcov didn't support the new coverage
format produced by gcc9+. The latest lcov release in MSYS2 supports
it again, so re-enable everything.

lcov now writes native Windows paths to its output so adjust the path
fixup script to handle those.
2020-10-01 14:07:14 +02:00
Philip Withnall
cbf72f0dc9 ci: Add model file for Coverity
This isn’t used in the build at all, it’s just a copy of the model file
which is uploaded in our Coverity configuration. This should be kept up
to date with changes in the file on the Coverity servers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-09-08 10:34:54 +01:00
Philip Withnall
c77c5e5b56 ci: Support building a CI image for Coverity Scan builds
This will be used in an upcoming scheduled CI job.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-07-27 15:41:09 +01:00
Philip Withnall
1378a40734 ci: Limit depth of fetch for initial code checks
Rather than fetching the entire repository history, limit the fetch
depth to commits in the last 4 weeks. If a branch was branched longer
than 4 weeks ago, it seems reasonable to require it to be rebased before
it can be reviewed.

At the current rate of development, this reduces the bandwidth needed
for git pulls in the initial code checks from 73MB to 9MB.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-07-25 01:15:02 +01:00
Philip Withnall
5c09c9e977 ci: Limit depth of subprojects when cloning
Use the depth= argument from Meson 0.52 to limit the clone depth of
subprojects to 1. This should make the CI images a little smaller, and
reduce the bandwidth required to build them (although that’s not so
important because it only happens once every few months).

Similarly, only clone to a depth of 1 in `cache-subprojects.sh`, which
is run once every few months.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-07-09 12:51:21 +01:00
Philip Withnall
00bfb3ab44 tree: Fix various typos and outdated terminology
This was mostly machine generated with the following command:
```
codespell \
    --builtin clear,rare,usage \
    --skip './po/*' --skip './.git/*' --skip './NEWS*' \
    --write-changes .
```
using the latest git version of `codespell` as per [these
instructions](https://github.com/codespell-project/codespell#user-content-updating).

Then I manually checked each change using `git add -p`, made a few
manual fixups and dropped a load of incorrect changes.

There are still some outdated or loaded terms used in GLib, mostly to do
with git branch terminology. They will need to be changed later as part
of a wider migration of git terminology.

If I’ve missed anything, please file an issue!

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-12 15:01:08 +01:00
Nirbheek Chauhan
ab6b764e24 ci: growing_stack should be true for android and ios
We can't run this test when cross-compiling, but we know what this
should be on Android and iOS.
2020-05-29 02:44:44 +05:30
Nirbheek Chauhan
e3ef2cdf82 .gitlab-ci: Add an example iOS cross file
This should be generated based on the available SDK versions and the
iPhone version you want to target, but that's something we can do
when adding macOS and iOS CI.
2020-05-29 01:17:14 +05:30
Philip Withnall
57ed909857 ci: Document access token permissions needed for uploading images
New, finer-grained permissions are now supported in GitLab.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Philip Withnall
cbcc0aa1ea ci: Handle missing suite information in test output JSON
The gtk-doc tests are hardcoded by Meson to output as `glib /
gio-doc-check`, `glib / gobject-doc-check`, etc., without an explicit
project name and suite. This causes the following exception in the
report parser:
```
Traceback (most recent call last):
  File ".gitlab-ci/meson-junit-report.py", line 50, in <module>
    (project_name, suite_name) = full_suite.split(':')
ValueError: not enough values to unpack (expected 2, got 1)
```

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Philip Withnall
74f1e58219 ci: Add python3-pip to Fedora dependencies
It’s needed to provide the `pip3` executable, which the `Dockerfile`
later uses.

Follow-up to !1464.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Bastien Nocera
62bffc294a ci: Update Fedora version to latest stable
This newer version of Fedora also includes a newer version of gtk-doc
that should satisfy the update dependency:
Dependency gtk-doc found: NO found '1.29' but need: '>=1.32'

See https://bodhi.fedoraproject.org/updates/FEDORA-2020-f93ef1b300
2020-05-07 11:13:57 +01:00
Christoph Reiter
534a92f35f CI: Make sure we use meson 0.49.2 in MSYS2
pip in MSYS2 seems to install scripts into $USERPROFILE instead of $HOME
which means the MSYS2 meson, which is newer, wins. Make sure $USERPROFILE
is in PATH as well.
2020-05-06 22:07:37 +02:00
Christoph Reiter
c3645a84b6 CI: Switch to new Windows runners
gitlab will drop cmd.exe support with GitLab 13 so I took the opportunity to
add new runners with Windows 2016 and powershell as default.

These runners are tagged with win32-ps instead of win32. The old runners
will be switched off in the coming weeks.

The main difference is that all commands and env expansions use powershell
and Windows 2016 instead of 2012r2.
2020-04-29 08:56:56 +02:00
Simon McVittie
dff2e3b4c7 CI: Show execution environment before we start
This will help to debug CI issues that are related to us running in
a container that might have unusual capabilities, mount points,
filesystems etc., such as (probably) #2027, #2028, #2029.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-03-04 15:25:47 +00:00
Philip Withnall
00dfb1de0f ci: Ensure run-check-todos.sh exits on the first error it encounters
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 10:33:45 +00:00
Philip Withnall
23d26cfe7e ci: Fix various shellcheck warnings in the shell scripts
I haven’t tested any of them. This is entirely mechanical. I used
shellcheck 0.7.0 with default options.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 10:33:45 +00:00
Philip Withnall
95479256df ci: Correctly propagate exit status in run-style-check-diff.sh
Spotted by Daniel Stone: the addition of the `echo` commands in commit
65541f1ad meant that the exit status from `clang-format-diff.py` was
being lost.

The incorrect use of `set +e` rather than `set -e` meant that
intermediate commands could fail without the failure being noticed.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-25 11:11:42 +00:00
Nirbheek Chauhan
ba5a18ace4 gitlab-ci: 64-bit ARM is aarch64, not arm64
We also already have conditionals using `aarch64` in the build files,
so `arm64` is completely wrong.

https://mesonbuild.com/Reference-tables.html#cpu-families
2020-02-24 10:24:02 +00:00
Bastien Nocera
4fe2c7ffdb ci: Update Fedora image before installing new items
This fixes some scriptlets crashes during package installation.
2020-02-04 17:28:07 +01:00