Files
xf86-video-fbdev/.gitlab-ci/common/xorg-driver.yml
Enrico Weigelt, metux IT consult 0f89fbffcb gitlab CI: common scripts for driver builds
Adding a bunch of common scripts for building xorg drivers on different
platforms (for now Debian and FreeBSD) against different server versions.

Also designed to be executed locally (eg. within a VM), so one doesn't
always have to employ f.d.o gitlab.

For now, these are synced manually across various driver repos, until we've
found a viable solution for a central place.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-06-06 17:27:45 +02:00

190 lines
5.8 KiB
YAML

# version 0.1.16
variables:
DEBIAN_VERSION: bullseye-slim
DEBIAN_TAG: "2024-06-06.02"
DEBIAN_EXEC: 'bash .gitlab-ci/common/debian/image-install.sh'
DEBIAN_SKIP: "false" # to enable, it has to be litterally "true"
FREEBSD_TAG: '2024-06-06.02'
FREEBSD_VERSION: '14.0'
# image is yet too small for that - need a more complicated way :(
# FREEBSD_EXEC: "bash .gitlab-ci/common/freebsd/image-install.sh"
FREEBSD_SKIP: "false" # to enable, it has to be litterally "true"
.templates_sha: &template_sha bc70242ffb8402243e934659ecc1a2d1c89eca2b # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/debian.yml'
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/freebsd.yml'
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/ci-fairy.yml'
- template: Security/SAST.gitlab-ci.yml
stages:
- images
- build
- test
# standard commits quality check
check-commits:
extends:
- .fdo.ci-fairy
stage: test
script:
- ci-fairy check-commits --junit-xml=results.xml
except:
- master@$FDO_UPSTREAM_REPO
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
allow_failure: true
needs:
# standard merge request quality checks
check-merge-request:
extends:
- .fdo.ci-fairy
stage: test
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
when: on_failure
reports:
junit: results.xml
allow_failure: true
needs:
# create debian build image
image@debian:
extends:
- .xorg.distro@debian
- .fdo.container-build@debian
stage: images
variables:
GIT_STRATEGY: none
rules:
- if: $DEBIAN_SKIP != "true"
when: always
needs:
# inherit this to define FDO_DISTRIBUTION_* variables for Debian
.xorg.distro@debian:
variables:
FDO_DISTRIBUTION_VERSION: "$DEBIAN_VERSION"
FDO_DISTRIBUTION_EXEC: "$DEBIAN_EXEC"
FDO_DISTRIBUTION_TAG: "$DEBIAN_TAG"
# overwrite this one if another matrix is needed
.xorg_driver_matrix@debian:
parallel:
matrix:
- CC: [ "gcc", "clang" ]
XSERVER_REF: [
# these break on Debian
# "xorg-server-1.18.4",
# "xorg-server-1.19.7",
"xorg-server-1.20.14",
"xorg-server-21.1.13",
"master"
]
# default build with meson on Debian
.xorg_driver_common@debian:
needs:
- image@debian
extends:
- .xorg.distro@debian
- .fdo.distribution-image@debian
stage: build
script:
- .gitlab-ci/common/build-driver.sh "debian" "$XSERVER_REF"
variables:
CFLAGS: "-pipe -g -O2"
rules:
- if: $DEBIAN_SKIP != "true"
when: always
# overwrite this when you need some special Debian build
build@debian:
extends:
- .xorg_driver_matrix@debian
- .xorg_driver_common@debian
# inherit this to define FDO_DISTRIBUTION_* variables for FreeBSD
.xorg.distro@freebsd:
variables:
FDO_DISTRIBUTION_VERSION: "$FREEBSD_VERSION"
FDO_DISTRIBUTION_EXEC: "$FREEBSD_EXEC"
FDO_DISTRIBUTION_TAG: "$FREEBSD_TAG"
# create base image for FreeBSD
image@freebsd:
extends:
- .xorg.distro@freebsd
- .fdo.qemu-build@freebsd@x86_64
stage: images
variables:
GIT_STRATEGY: none
rules:
- if: $FREEBSD_SKIP != "true"
when: always
# inherit this to get the default build matrix
.xorg_driver_matrix@freebsd:
parallel:
matrix:
- CC: [ "gcc", "clang" ]
XSERVER_REF: [
# "xorg-server-1.18.4", # this breaks due name clash on "bool"
# "xorg-server-1.19.7",
# "xorg-server-1.20.14", # breaks meson ... see: 331850ce6f0c48a1cfc489da2a27ca0220997a2f -- server-1.20-branch
"xorg-server-21.0.99.1",
"xorg-server-21.1.13",
"master"
]
# common build for driver on FreeBSD. meson and autoconf are both handled by this
.xorg_driver_common@freebsd:
needs:
- image@freebsd
stage: build
extends:
- .fdo.distribution-image@freebsd
- .xorg.distro@freebsd
script:
# FIXME: increasing image and running image-install.sh should be done
# at container image build time, but would have to replicate too much
# of the cbuild script here. better wait until CI folks have increased
# the image size or provide hooks for that
- xz -d -T0 /app/image.raw.xz
- rm -f /app/image.raw.xz
- truncate -s +5G /app/image.raw
- /app/vmctl start
- set +e
- /app/vmctl exec "gpart recover /dev/ada0 && gpart resize -i4 /dev/ada0 && growfs -y /"
- scp -r $PWD "vm:"
- /app/vmctl exec "cd $CI_PROJECT_NAME && .gitlab-ci/common/freebsd/image-install.sh"
- /app/vmctl exec "cd $CI_PROJECT_NAME && .gitlab-ci/common/build-driver.sh freebsd $XSERVER_REF" && touch .success
# copy any test results from the VM to our container so we can
# save them as artifacts
- scp -r vm:$CI_PROJECT_NAME/test-results.xml . || true # this is allowed to fail
- /app/vmctl stop
- set -e
- test -e .success || exit 1
rules:
- if: $FREEBSD_SKIP != "true"
when: always
# overwrite this if you need some special FreeBSD build
build@freebsd:
extends:
- .xorg_driver_matrix@freebsd
- .xorg_driver_common@freebsd