mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 02:10:07 +01:00
The only thing this checked was the checkbox for allowing maintainers to edit the MR. Changed permissions checks now fail this job but luckily the setting it checked has been the default for years anyway so we can drop it. https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/81 Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1332>
803 lines
25 KiB
YAML
803 lines
25 KiB
YAML
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
|
|
|
|
{# You're looking at the template here, so you can ignore the below
|
|
warning. This is the right file to edit #}
|
|
########################################
|
|
# #
|
|
# THIS FILE IS GENERATED, DO NOT EDIT #
|
|
# #
|
|
########################################
|
|
|
|
# To change the gitlab CI, edit .gitlab-ci/ci.template and/or .gitlab-ci/config.yaml
|
|
# and run ci-fairy generate-template. For details, see
|
|
# https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html#templating-gitlab-ci-yml
|
|
|
|
# This is a bit complicated for two reasons:
|
|
# - we really want to run dnf/apt/... only once, updating on the test runner for
|
|
# each job takes forever. So we create a container image for each distribution
|
|
# tested, then run the tests on this container image.
|
|
#
|
|
# This is handled by the ci-templates, ensuring containers are only rebuilt
|
|
# when the TAG changes.
|
|
#
|
|
# - GitLab only allows one script: set per job but we have a bunch of commands
|
|
# we need to re-run for each build (meson && ninja && etc). YAML cannot merge
|
|
# arrays so we're screwed.
|
|
#
|
|
# So instead we use a default_build template and override everything with
|
|
# variables. The only two variables that matter:
|
|
# MESON_ARGS=-Denable-something=true
|
|
# NINJA_ARGS=dist ... to run 'ninja -C builddir dist'
|
|
# Note that you cannot use scripts: in any target if you expect default_build
|
|
# to work.
|
|
#
|
|
#
|
|
# All jobs must follow the naming scheme of
|
|
# <distribution>:<version>@activity:
|
|
# e.g. fedora:31@build-default
|
|
|
|
.templates_sha: &template_sha c6aeb16f86e32525fa630fb99c66c4f3e62fc3cb
|
|
|
|
include:
|
|
- project: 'freedesktop/ci-templates'
|
|
ref: *template_sha
|
|
file:
|
|
- '/templates/ci-fairy.yml'
|
|
{% for distro in distributions|sort(attribute="name") %}
|
|
# {{ distro.name.capitalize() }} container builder template
|
|
- '/templates/{{distro.name}}.yml'
|
|
{% endfor %}
|
|
|
|
workflow:
|
|
rules:
|
|
# do not duplicate pipelines on merge pipelines
|
|
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
|
|
when: never
|
|
# merge pipeline
|
|
- if: &is-merge-attempt $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
variables:
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
|
|
# post-merge pipeline
|
|
- if: &is-post-merge $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "push"
|
|
variables:
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
|
|
# Pre-merge pipeline
|
|
- if: &is-pre-merge $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
# Push to a branch on a fork
|
|
- if: $CI_COMMIT_BRANCH
|
|
|
|
stages:
|
|
- sanity check # CI/commit checks
|
|
- prep # prep work like rebuilding the container images if there is a change
|
|
- build # for actually building and testing things in a container
|
|
- test-suite # for running the test suite in a VM
|
|
- test-suite-no-libwacom # for running the test suite in a VM (libwacom disabled)
|
|
- valgrind # for running the test suite under valgrind in a VM
|
|
- distro # distribs test
|
|
- deploy # trigger wayland's website generation
|
|
- container_clean # clean up unused container images (scheduled jobs only)
|
|
|
|
variables:
|
|
###############################################################################
|
|
# This is the list of packages required to build libinput with the default #
|
|
# configuration. #
|
|
# #
|
|
# Run dnf install/apt-get install/.. with the list of packages for your #
|
|
# distribution #
|
|
# #
|
|
# See the documentation here: #
|
|
# https://wayland.freedesktop.org/libinput/doc/latest/building.html #
|
|
###############################################################################
|
|
{% for distro in distributions %}
|
|
{{"%-17s" | format(distro.name.upper() + '_PACKAGES:')}} '{{ distro.packages|join(' ')}}'
|
|
{% endfor %}
|
|
############################ end of package lists #############################
|
|
|
|
# these tags should be updated each time the list of packages is updated
|
|
# changing these will force rebuilding the associated image
|
|
# Note: these tags have no meaning and are not tied to a particular
|
|
# libinput version
|
|
{% for distro in distributions %}
|
|
{{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}'
|
|
{% endfor %}
|
|
|
|
FDO_UPSTREAM_REPO: libinput/libinput
|
|
|
|
MESON_BUILDDIR: "build dir"
|
|
NINJA_ARGS: ''
|
|
MESON_ARGS: ''
|
|
MESON_TEST_ARGS: '--no-suite=hardware'
|
|
|
|
# udev isn't available/working properly in the containers
|
|
UDEV_NOT_AVAILABLE: 1
|
|
GIT_DEPTH: 1
|
|
|
|
# Default priority for non-merge pipelines
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: "" # Empty tags are ignored by gitlab
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: kvm
|
|
FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: aarch64
|
|
|
|
.policy:
|
|
retry:
|
|
max: 2
|
|
when:
|
|
- runner_system_failure
|
|
- stuck_or_timeout_failure
|
|
# cancel run when a newer version is pushed to the branch
|
|
interruptible: true
|
|
dependencies: []
|
|
|
|
.policy-retry-on-failure:
|
|
retry:
|
|
max: 1
|
|
when:
|
|
- runner_system_failure
|
|
- stuck_or_timeout_failure
|
|
# cancel run when a newer version is pushed to the branch
|
|
interruptible: true
|
|
dependencies: []
|
|
|
|
.default_artifacts:
|
|
artifacts:
|
|
name: "meson-logs-$CI_JOB_NAME"
|
|
when: always
|
|
expire_in: 1 week
|
|
paths:
|
|
- $MESON_BUILDDIR/meson-logs
|
|
- $MESON_BUILDDIR/valgrind.*.log
|
|
reports:
|
|
junit: $MESON_BUILDDIR/*junit*.xml
|
|
|
|
.fdo-runner-tags:
|
|
tags:
|
|
- $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64
|
|
|
|
|
|
#################################################################
|
|
# #
|
|
# sanity check stage #
|
|
# #
|
|
#################################################################
|
|
|
|
fail-if-fork-is-not-public:
|
|
extends:
|
|
- .fdo-runner-tags
|
|
stage: sanity check
|
|
script:
|
|
- |
|
|
if [ $CI_PROJECT_VISIBILITY != "public" ]; then
|
|
echo "*************************************************************************************"
|
|
echo "Project visibility must be set to 'public'"
|
|
echo "Change this in $CI_PROJECT_URL/edit under 'Visibility, project features, permissions'"
|
|
echo "*************************************************************************************"
|
|
exit 1
|
|
fi
|
|
except:
|
|
- main@libinput/libinput
|
|
|
|
# Re-generate the CI script and make sure it's the one currently checked in
|
|
# If this job fails, re-generate the gitlab-ci.yml script, see
|
|
# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
|
|
#
|
|
check-ci-script:
|
|
extends:
|
|
- .fdo.ci-fairy
|
|
- .fdo-runner-tags
|
|
stage: sanity check
|
|
script:
|
|
- ci-fairy generate-template --verify && exit 0 || true
|
|
- >
|
|
printf "%s\n" \
|
|
"Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" \
|
|
"https://wayland.freedesktop.org/libinput/doc/latest/contributing.html"
|
|
- exit 1
|
|
|
|
#
|
|
# Verify that commit messages are as expected, etc.
|
|
#
|
|
|
|
check-commit:
|
|
extends:
|
|
- .fdo.ci-fairy
|
|
- .fdo-runner-tags
|
|
stage: sanity check
|
|
script:
|
|
- ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
|
|
- >
|
|
printf "%s\n" \
|
|
"Error checking commit format. Please verify" \
|
|
"https://wayland.freedesktop.org/libinput/doc/latest/contributing.html"
|
|
- exit 1
|
|
except:
|
|
- main@libinput/libinput
|
|
variables:
|
|
GIT_DEPTH: 100
|
|
artifacts:
|
|
reports:
|
|
junit: results.xml
|
|
|
|
|
|
#
|
|
# Check for trailing whitespaces
|
|
#
|
|
|
|
check-whitespace:
|
|
extends:
|
|
- .fdo.ci-fairy
|
|
- .fdo-runner-tags
|
|
stage: sanity check
|
|
script:
|
|
- .gitlab-ci/whitespace-check.py $(git ls-files)
|
|
|
|
#
|
|
# pre-commit hooks
|
|
#
|
|
|
|
pre-commit-hooks:
|
|
extends:
|
|
- .fdo.ci-fairy
|
|
- .fdo-runner-tags
|
|
stage: sanity check
|
|
script:
|
|
- python3 -m venv venv
|
|
- source venv/bin/activate
|
|
- pip3 install pre-commit
|
|
- pre-commit run --all-files
|
|
- git diff --exit-code || (echo "ERROR - Code style errors found, please fix" && false)
|
|
|
|
#################################################################
|
|
# #
|
|
# prep stage #
|
|
# #
|
|
#################################################################
|
|
|
|
{% for distro in distributions %}
|
|
{% for version in distro.versions %}
|
|
{{distro.name}}:{{version}}@container-prep:
|
|
extends:
|
|
{% if distro.qemu_based %}
|
|
- .fdo.qemu-build@{{distro.name}}
|
|
{% else %}
|
|
- .fdo.container-build@{{distro.name}}
|
|
{% endif %}
|
|
- .policy
|
|
- .fdo-runner-tags
|
|
{% if distro.qemu_based %}
|
|
tags:
|
|
- $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
|
|
{% endif %}
|
|
stage: prep
|
|
variables:
|
|
GIT_STRATEGY: none
|
|
FDO_DISTRIBUTION_VERSION: '{{version}}'
|
|
FDO_DISTRIBUTION_PACKAGES: ${{distro.name.upper()}}_PACKAGES
|
|
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
|
|
|
|
{% endfor %}
|
|
{% endfor %}
|
|
|
|
|
|
#################################################################
|
|
# #
|
|
# container clean stage #
|
|
# run during the clean stage #
|
|
# #
|
|
#################################################################
|
|
|
|
#
|
|
# This stage will look for the container images we currently have in
|
|
# the registry and will remove any that are not tagged with the provided
|
|
# $container_image:$tag
|
|
#
|
|
.container-clean:
|
|
extends:
|
|
- .policy
|
|
- .fdo.ci-fairy
|
|
- .fdo-runner-tags
|
|
stage: container_clean
|
|
script:
|
|
# Go to your Profile, Settings, Access Tokens
|
|
# Create a personal token with 'api' scope, copy the value.
|
|
# Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
|
|
# Define a variable of type File named AUTHFILE. Content is that token
|
|
# value.
|
|
- ci-fairy -v --authfile $AUTHFILE delete-image
|
|
--repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
|
|
--exclude-tag $FDO_DISTRIBUTION_TAG
|
|
allow_failure: true
|
|
only:
|
|
- schedules
|
|
|
|
{% for distro in distributions %}
|
|
{% for version in distro.versions %}
|
|
{{distro.name}}:{{version}}@container-clean:
|
|
extends:
|
|
- .policy
|
|
- .container-clean
|
|
variables:
|
|
GIT_STRATEGY: none
|
|
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/{{distro.name}}/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
|
|
FDO_DISTRIBUTION_VERSION: '{{version}}'
|
|
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
|
|
|
|
{% endfor %}
|
|
{% endfor %}
|
|
|
|
#################################################################
|
|
# #
|
|
# build stage #
|
|
# #
|
|
#################################################################
|
|
|
|
.build@template:
|
|
extends:
|
|
- .policy
|
|
- .default_artifacts
|
|
- .fdo-runner-tags
|
|
stage: build
|
|
script:
|
|
- .gitlab-ci/meson-build.sh
|
|
|
|
|
|
# Run meson and meson test in the container image through qemu
|
|
.build-in-vng@template:
|
|
extends:
|
|
- .policy
|
|
- .default_artifacts
|
|
tags:
|
|
- $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
|
|
variables:
|
|
MESON_BUILDDIR: build_dir
|
|
VNG_KERNEL: {{ vng.kernel }}
|
|
script:
|
|
# first build in the host container
|
|
- .gitlab-ci/meson-build.sh --skip-test
|
|
|
|
- mkdir -p $MESON_BUILDDIR
|
|
- curl -LO $VNG_KERNEL
|
|
|
|
- export -p > .vngenv
|
|
|
|
# runs the test suite only
|
|
- |
|
|
vng --run ./bzImage \
|
|
--user root \
|
|
--overlay-rwdir=$HOME \
|
|
--append HOME=$HOME \
|
|
--overlay-rwdir=$(pwd) \
|
|
--rwdir=$MESON_BUILDDIR \
|
|
--exec "source $PWD/.vngenv; rm $PWD/.vngenv; .gitlab-ci/meson-build.sh --skip-setup --skip-build --run-test"
|
|
|
|
#
|
|
# Fedora
|
|
#
|
|
|
|
.check_tainted: &check_tainted |
|
|
# make sure the kernel is not tainted
|
|
if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
|
|
then
|
|
echo tainted kernel ;
|
|
exit 1 ;
|
|
fi
|
|
|
|
# Run meson and meson test in the qemu image
|
|
.build-in-qemu@template:
|
|
extends:
|
|
- .policy
|
|
tags:
|
|
- $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
|
|
variables:
|
|
MESON_BUILDDIR: build_dir
|
|
script:
|
|
# start our vm, no args required
|
|
- /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
|
|
|
|
- *check_tainted
|
|
|
|
- "scp -r $PWD vm:"
|
|
- echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
|
|
- echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
|
|
- echo "MESON_ARGS=\"$MESON_ARGS\"" >> sshenv
|
|
- echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
|
|
- echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
|
|
- echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
|
|
- "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment"
|
|
- /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
|
|
# no matter the results of the tests, we want to fetch the logs
|
|
- scp -r vm:$CI_PROJECT_NAME/$MESON_BUILDDIR .
|
|
|
|
- *check_tainted
|
|
|
|
- /app/vmctl stop
|
|
|
|
- if [[ ! -e .success ]] ;
|
|
then
|
|
exit 1 ;
|
|
fi
|
|
artifacts:
|
|
name: "qemu-meson-logs-$CI_JOB_NAME"
|
|
when: always
|
|
expire_in: 1 week
|
|
paths:
|
|
- $MESON_BUILDDIR/meson-logs
|
|
- console.out
|
|
reports:
|
|
junit: $MESON_BUILDDIR/*junit*.xml
|
|
|
|
|
|
# Run in a test suite. Special variables:
|
|
# - SUITES: the meson test suites to run, or
|
|
# - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
|
|
# Set one or the other, not both.
|
|
.test-suite-vm:
|
|
extends:
|
|
- .build-in-vng@template
|
|
stage: test-suite
|
|
variables:
|
|
# remove the global --no-suite=hardware
|
|
MESON_TEST_ARGS: ''
|
|
LITEST_JOBS: 4
|
|
before_script:
|
|
- if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
|
|
- echo "Testing $SUITES"
|
|
- export MESON_TEST_ARGS="$MESON_TEST_ARGS $SUITES"
|
|
|
|
|
|
{# qemu tests are only done for the latest version of any distribution #}
|
|
{% for distro in distributions if distro.use_for_qemu_tests %}
|
|
{% set version = "{}".format(distro.versions|last()) %}
|
|
.{{distro.name}}:{{version}}@test-suite-vm:
|
|
extends:
|
|
- .fdo.distribution-image@{{distro.name}}
|
|
- .test-suite-vm
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: {{version}}
|
|
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
|
|
needs:
|
|
- "{{distro.name}}:{{version}}@container-prep"
|
|
|
|
|
|
{% for suite in test_suites %}
|
|
vm-{{suite.name}}:
|
|
extends:
|
|
- .{{distro.name}}:{{version}}@test-suite-vm
|
|
variables:
|
|
SUITE_NAMES: '{{suite.suites|join(' ')}}'
|
|
|
|
vm-{{suite.name}}-no-libwacom:
|
|
extends:
|
|
- vm-{{suite.name}}
|
|
stage: test-suite-no-libwacom
|
|
variables:
|
|
MESON_ARGS: '-Dlibwacom=false'
|
|
|
|
{% endfor %}
|
|
|
|
{% for suite in test_suites %}
|
|
vm-valgrind-{{suite.name}}:
|
|
stage: valgrind
|
|
extends:
|
|
- vm-{{suite.name}}
|
|
- .policy-retry-on-failure
|
|
variables:
|
|
MESON_TEST_ARGS: '--setup=valgrind'
|
|
LITEST_JOBS: 0
|
|
retry:
|
|
max: 2
|
|
rules:
|
|
- if: $GITLAB_USER_LOGIN != "marge-bot"
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}{# for if distro.use_for_qemu_tests #}
|
|
|
|
{% for distro in distributions if distro.use_for_custom_build_tests %}
|
|
{% set version = "{}".format(distro.versions|last()) %}
|
|
.{{distro.name}}-build@template:
|
|
extends:
|
|
- .fdo.distribution-image@{{distro.name}}
|
|
- .build@template
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: '{{version}}'
|
|
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
|
|
needs:
|
|
- "{{distro.name}}:{{version}}@container-prep"
|
|
|
|
default-build-release@{{distro.name}}:{{version}}:
|
|
stage: distro
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dbuildtype=release"
|
|
CFLAGS: "-Werror"
|
|
|
|
clang-tidy@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
NINJA_ARGS: ''
|
|
MESON_TEST_ARGS: ''
|
|
CC: 'clang'
|
|
script:
|
|
- .gitlab-ci/meson-build.sh
|
|
- ninja -C "$MESON_BUILDDIR" clang-tidy
|
|
|
|
# Below jobs are build option combinations. We only
|
|
# run them on one image, they shouldn't fail on one distro
|
|
# when they succeed on another.
|
|
|
|
build-no-libwacom@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dlibwacom=false"
|
|
|
|
build-no-libwacom-nodeps@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dlibwacom=false"
|
|
before_script:
|
|
- dnf remove -y libwacom libwacom-devel
|
|
|
|
build-no-mtdev@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dmtdev=false"
|
|
|
|
build-no-mtdev-nodeps@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dmtdev=false"
|
|
before_script:
|
|
- dnf remove -y mtdev mtdev-devel
|
|
|
|
build-no-lua@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dlua-plugins=disabled"
|
|
|
|
build-no-lua-nodeps@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dlua-plugins=disabled"
|
|
before_script:
|
|
- dnf remove -y lua lua-devel
|
|
|
|
build-docs@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Ddocumentation=true"
|
|
|
|
build-no-docs-nodeps@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Ddocumentation=false"
|
|
before_script:
|
|
- dnf remove -y doxygen graphviz
|
|
|
|
build-no-debuggui@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Ddebug-gui=false"
|
|
|
|
build-no-debuggui-nodeps@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Ddebug-gui=false"
|
|
before_script:
|
|
- dnf remove -y gtk3-devel gtk4-devel
|
|
|
|
build-no-tests@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dtests=false"
|
|
|
|
build-no-tests-nodeps@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_ARGS: "-Dtests=false"
|
|
before_script:
|
|
- dnf remove -y check-devel
|
|
|
|
valgrind@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
variables:
|
|
MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
|
|
|
|
# Python checks, only run on Fedora
|
|
|
|
usr-bin-env-python@{{distro.name}}:{{version}}:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
script:
|
|
- |
|
|
if git grep -l '^#!/usr/bin/python'; then
|
|
echo "Use '/usr/bin/env python3' in the above files";
|
|
/bin/false
|
|
fi
|
|
|
|
# A job to check we're actually running all test suites in the CI
|
|
check-test-suites:
|
|
extends:
|
|
- .{{distro.name}}-build@template
|
|
script:
|
|
- meson setup builddir
|
|
- meson introspect builddir --test | jq -r '.[].name' | grep 'libinput-test-suite' | sort > meson-testsuites
|
|
- |
|
|
cat <<EOF > ci-testsuites ;
|
|
{% for suite in test_suites %}
|
|
{% for name in suite.suites %}
|
|
libinput-test-suite-{{name}}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
EOF
|
|
- sort -o ci-testsuites ci-testsuites
|
|
- diff -u8 -w ci-testsuites meson-testsuites || (echo "Some test suites are not run in the CI" && false)
|
|
only:
|
|
changes:
|
|
- "meson.build"
|
|
- ".gitlab-ci.yml"
|
|
{% endfor %}
|
|
|
|
#
|
|
# coverity run
|
|
#
|
|
# This requires the COVERITY_SCAN_TOKEN. Log into scan.coverity.com and get
|
|
# the token from the respective project settings page.
|
|
# Schedule a pipeline and set a variable COVERITY_SCAN_TOKEN with the token value.
|
|
# https://gitlab.freedesktop.org/$CI_PROJECT_PATH/-/pipeline_schedules
|
|
# Email from coverity will be sent to the GITLAB_USER_EMAIL that scheduled the
|
|
# job.
|
|
#
|
|
# Coverity ratelimits submissions and the coverity tools download is about
|
|
# 700M, do not run this too often.
|
|
#
|
|
coverity:
|
|
extends:
|
|
- .fdo.distribution-image@debian
|
|
- .policy
|
|
- .fdo-runner-tags
|
|
stage: build
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: 'stable'
|
|
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
|
|
# so git-describe works, or should work
|
|
GIT_DEPTH: 200
|
|
only:
|
|
variables:
|
|
- $COVERITY_SCAN_TOKEN
|
|
script:
|
|
- curl https://scan.coverity.com/download/linux64
|
|
-o /tmp/cov-analysis-linux64.tgz
|
|
--form project=$CI_PROJECT_NAME
|
|
--form token=$COVERITY_SCAN_TOKEN
|
|
- tar xfz /tmp/cov-analysis-linux64.tgz
|
|
# coverity has special build options in meson, make sure we enable those
|
|
- meson coverity-build -Ddocumentation=false -Dcoverity=true
|
|
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C coverity-build
|
|
- tar cfz cov-int.tar.gz cov-int
|
|
- curl https://scan.coverity.com/builds?project=$CI_PROJECT_NAME
|
|
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
|
|
--form file=@cov-int.tar.gz --form version="$(git describe --tags)"
|
|
--form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
|
|
artifacts:
|
|
name: "coverity-submit-data"
|
|
when: always
|
|
expire_in: 1 week
|
|
paths:
|
|
- cov-int.tar.gz
|
|
needs:
|
|
- "debian:stable@container-prep"
|
|
|
|
#################################################################
|
|
# #
|
|
# distro stage #
|
|
# #
|
|
#################################################################
|
|
|
|
{% for distro in distributions %}
|
|
{% if not distro.qemu_based %}
|
|
{% for version in distro.versions %}
|
|
{{distro.name}}:{{version}}@default-build:
|
|
stage: distro
|
|
extends:
|
|
- .build@template
|
|
- .fdo.distribution-image@{{distro.name}}
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: '{{version}}'
|
|
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
|
|
{# Where we have extra_variables defined, add them to the list #}
|
|
{% if distro.build is defined and distro.build.extra_variables is defined %}
|
|
{% for var in distro.build.extra_variables %}
|
|
{{var}}
|
|
{% endfor %}
|
|
{% endif %}
|
|
needs:
|
|
- "{{distro.name}}:{{version}}@container-prep"
|
|
|
|
|
|
{% endfor %}
|
|
{% else %}
|
|
{% set version = "{}".format(distro.versions|last()) %}
|
|
{{distro.name}}:{{version}}@default-build:
|
|
stage: distro
|
|
extends:
|
|
- .build-in-qemu@template
|
|
- .fdo.distribution-image@{{distro.name}}
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: '{{version}}'
|
|
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
|
|
{# Where we have extra_variables defined, add them to the list #}
|
|
{% if distro.build is defined and distro.build.extra_variables is defined %}
|
|
{% for var in distro.build.extra_variables %}
|
|
{{var}}
|
|
{% endfor %}
|
|
{% endif %}
|
|
needs:
|
|
- "{{distro.name}}:{{version}}@container-prep"
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
#################################################################
|
|
# #
|
|
# deploy stage #
|
|
# #
|
|
#################################################################
|
|
|
|
{% for distro in distributions if distro.name == "fedora" %}
|
|
{% set version = "{}".format(distro.versions|last()) %}
|
|
build rpm:
|
|
extends:
|
|
- .fdo.distribution-image@fedora
|
|
- .policy
|
|
- .fdo-runner-tags
|
|
stage: deploy
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: '{{version}}'
|
|
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
|
|
needs:
|
|
- "fedora:{{version}}@container-prep"
|
|
script:
|
|
- meson "$MESON_BUILDDIR"
|
|
- VERSION=$(meson introspect "$MESON_BUILDDIR" --projectinfo | jq -r .version)
|
|
- sed -e "s/@PIPELINEID@/${CI_PIPELINE_ID}/"
|
|
-e "s/@GITVERSION@/${CI_COMMIT_SHA}/"
|
|
-e "s/@VERSION@/${VERSION}/" .gitlab-ci/libinput.spec.in > libinput.spec
|
|
- git config --local user.name 'gitlab CI'
|
|
- git config --local user.email 'noreply@nowhere'
|
|
- git add libinput.spec && git commit -m 'Add libinput.spec for build testing' libinput.spec
|
|
- cd "$MESON_BUILDDIR"
|
|
- meson dist --no-test
|
|
- rpmbuild -ta meson-dist/libinput*.tar.xz
|
|
{% endfor %}
|
|
|
|
|
|
wayland-web:
|
|
stage: deploy
|
|
trigger: wayland/wayland.freedesktop.org
|
|
variables:
|
|
MESON_ARGS: '-Ddocumentation=true -Ddebug-gui=false -Dlibwacom=false -Dtests=false'
|
|
MESON_BUILDDIR: 'builddir'
|
|
rules:
|
|
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
|
when: never
|
|
- if: '$CI_COMMIT_BRANCH == "main" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_PROJECT_PATH == $FDO_UPSTREAM_REPO'
|
|
when: on_success
|
|
- when: never
|