diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-06-16 15:53:15 +1000 |
---|---|---|
committer | Sergey Udaltsov <sergey.udaltsov@gmail.com> | 2020-06-22 08:50:16 +0000 |
commit | cae0c7d8fa123c63a2b2de95071afca5415eb986 (patch) | |
tree | 7ffb568451884c84ef3021534d8be5c022ba4e94 /.gitlab-ci.yml | |
parent | 118178208e6aebea5b9c85edb752a50e82bb3144 (diff) | |
download | xkeyboard-config-cae0c7d8fa123c63a2b2de95071afca5415eb986.tar.gz |
gitlab CI: use ci-fairy to check merge requests
The fdo ci-templates provide a tool called ci-fairy which can check
merge requests as part of a pipeline. In this case we check for the checkbox
set to allow collaboration (i.e. the one that allows a maintainer to rebase a
merge request). Where it is missing, the CI job fails (though it's not fatal).
ci-fairy uses FDO_UPSTREAM_REPO to get the upstream repository, see the docs
for more details
https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html#checking-merge-requests
Output is both on stdout and as junit file which is presented nicely by
gitlab. Provided anyone reads it...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d5f675..dfe64e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,12 @@ variables: # Override these in the jobs to pass commands to configure/make CONFIGURE_ARGS: '' MAKE_EXTRA_ARG: '' + FDO_UPSTREAM_REPO: 'xkeyboard-config/xkeyboard-config' + +stages: + - prep + - build + - test # We use arch because the image updates frequently and we're not stuck # forever in the update phase @@ -42,6 +48,24 @@ variables: - ninja -C "$BUILDDIR" - if test x"$NINJA_EXTRA_COMMAND" != "x"; then ninja -C "$BUILDDIR" $NINJA_EXTRA_COMMAND; fi +# +# Verify that the merge request has the allow-collaboration checkbox ticked +# + +check-merge-request: + image: golang:alpine + stage: prep + before_script: + - apk add python3 py-pip git + - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates + script: + - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml + artifacts: + when: on_failure + reports: + junit: results.xml + allow_failure: true + make_install: extends: .default_build stage: build |