cairo/.gitlab-ci.yml
Emmanuele Bassi 9cfa510464 ci: Make Windows jobs manual
The CI runners for Windows are currently timing out on the fd.o
infrastructure. The issue is being worked on, but we should avoid
blocking our entire CI pipeline until it's fixed, as it sounds it is
going to take a while.
2022-02-25 12:54:11 +00:00

357 lines
11 KiB
YAML

# -*- indent-tabs-mode: nil -*-
include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
- project: 'freedesktop/ci-templates'
ref: '88ed1082df2af02090916566742543f1dbaee988'
file: '/templates/fedora.yml'
variables:
FDO_UPSTREAM_REPO: 'cairo/cairo'
FDO_DISTRIBUTION_VERSION: '34'
FDO_DISTRIBUTION_TAG: '2021-08-26.0'
# TODO: should probably get its own image at some point instead of reusing the GStreamer one
# See https://gitlab.freedesktop.org/gstreamer/gstreamer/container_registry/18035 for latest
WINDOWS_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2021-10-04.1-main"
DEFAULT_MESON_ARGS: >
--default-library=both
-Dgl-backend=auto
-Dglesv2=auto
-Dglesv3=auto
stages:
- prep
- build
- test
# Global CI policy: This can be used to configure global behaviour our our jobs
default:
retry:
max: 2
when:
- 'runner_system_failure'
- 'stuck_or_timeout_failure'
- 'scheduler_failure'
- 'api_failure'
interruptible: true
.ccache_setup:
variables:
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
CCACHE_DIR: "$CI_PROJECT_DIR/ccache"
CC: "ccache gcc"
CXX: "ccache g++"
before_script:
- mkdir -p ccache
- ccache --show-stats
cache:
# Each job will have it's own cache
key: "$CI_JOB_NAME"
paths:
- ccache/
fedora image:
extends:
- '.fdo.container-build@fedora'
stage: 'prep'
variables:
FDO_DISTRIBUTION_PACKAGES: >
meson
ninja-build
ccache
gcc
g++
zlib-devel
expat-devel
libpng-devel
fontconfig-devel
freetype-devel
libX11-devel
libXrender-devel
glib2-devel
librsvg2-devel
gtk2-devel
poppler-glib-devel
pixman-devel
systemd-devel
systemd-udev
mesa-libEGL
mesa-libGL
mesa-libGL-devel
mesa-libgbm
mesa-libgbm-devel
mesa-libglapi
expat-devel
autoconf
automake
make
which
libtool
diffutils
xorg-x11-server-Xvfb
dejavu-sans-fonts
dejavu-sans-mono-fonts
dejavu-serif-fonts
google-noto-emoji-color-fonts
fedora autotools build:
extends:
- '.fdo.distribution-image@fedora'
- '.ccache_setup'
stage: 'build'
script:
- ./autogen.sh
- make V=1 VERBOSE=1
artifacts:
when: 'always'
expire_in: '2 days'
paths:
- "*"
.test fedora autotools:
dependencies:
- 'fedora autotools build'
needs:
- 'fedora autotools build'
extends:
- '.fdo.distribution-image@fedora'
- '.ccache_setup'
stage: 'test'
artifacts:
when: 'always'
expire_in: "7 days"
paths:
- config.log
- test/*.log
- test/pdiff/*.log
- test/output
exclude:
- "test/**/*.cs"
- "test/**/*.trace"
test fedora autotools pdf:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_IGNORE_pdf_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-pdf-argb32.txt)
- export CAIRO_TEST_IGNORE_pdf_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-pdf-rgb24.txt)
- export CAIRO_TEST_TARGET=pdf
- xvfb-run make check V=1 VERBOSE=1
test fedora autotools script:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_UGLY_HACK_TO_SOMETIMES_IGNORE_SCRIPT_XCB_HUGE_IMAGE_SHM=1
- export CAIRO_TEST_IGNORE_script_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-script-argb32.txt)
- export CAIRO_TEST_TARGET=script
- xvfb-run make check V=1 VERBOSE=1
test fedora autotools image:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_IGNORE_image_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-image-argb32.txt)
- export CAIRO_TEST_IGNORE_image_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-image-rgb24.txt)
- export CAIRO_TEST_IGNORE_image16_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-image16-rgb24.txt)
- export CAIRO_TEST_TARGET=image,image16
- xvfb-run make check V=1 VERBOSE=1
test fedora autotools recording:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_IGNORE_recording_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-recording-argb32.txt)
- export CAIRO_TEST_IGNORE_recording_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-recording-rgb24.txt)
- export CAIRO_TEST_TARGET=recording
- xvfb-run make check V=1 VERBOSE=1
test fedora autotools svg:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_IGNORE_svg11_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-svg11-argb32.txt)
- export CAIRO_TEST_IGNORE_svg11_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-svg11-rgb24.txt)
- export CAIRO_TEST_TARGET=svg11
- export CAIRO_BOILERPLATE_OPEN_NO_DAEMON=1
- export CAIRO_BOILERPLATE_DO_NOT_CRASH_ON_ANY2PPM_ERROR=1
- export ANY2PPM="timeout 3m ./any2ppm"
- ulimit -S -s 131072
- xvfb-run make check V=1 VERBOSE=1
test fedora autotools xcb:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_IGNORE_xcb_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-xcb-argb32.txt)
- export CAIRO_TEST_IGNORE_xcb_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xcb-rgb24.txt)
- export CAIRO_TEST_IGNORE_xcb_window_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xcb-window-rgb24.txt)
- export CAIRO_TEST_IGNORE_xcb_window__rgb24=$(tr '\n' ',' < '.gitlab-ci/ignore-xcb-window&-rgb24.txt')
- export CAIRO_TEST_IGNORE_xcb_render_0_0_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-xcb-render-0-0-argb32.txt)
- export CAIRO_TEST_IGNORE_xcb_render_0_0_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xcb-render-0-0-rgb24.txt)
- export CAIRO_TEST_IGNORE_xcb_fallback_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xcb-fallback-rgb24.txt)
- export CAIRO_TEST_TARGET="xcb,xcb-window,xcb-window&,xcb-render-0_0,xcb-fallback"
- xvfb-run make check V=1 VERBOSE=1
test fedora autotools xlib:
extends: '.test fedora autotools'
script:
- export CAIRO_TEST_IGNORE_xlib_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-xlib-argb32.txt)
- export CAIRO_TEST_IGNORE_xlib_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xlib-rgb24.txt)
- export CAIRO_TEST_IGNORE_xlib_window_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xlib-window-rgb24.txt)
- export CAIRO_TEST_IGNORE_xlib_render_0_0_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xlib-render-0-0-rgb24.txt)
- export CAIRO_TEST_IGNORE_xlib_fallback_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-xlib-fallback-rgb24.txt)
- export CAIRO_TEST_TARGET="xlib,xlib-window,xlib-render-0_0,xlib-fallback"
- xvfb-run make check V=1 VERBOSE=1
fedora meson build:
extends:
- '.fdo.distribution-image@fedora'
- '.ccache_setup'
stage: 'build'
variables:
MESON_ARGS: >
${DEFAULT_MESON_ARGS}
-Dgl-backend=gl
script:
- meson builddir ${MESON_ARGS}
- ninja -C builddir
# - ninja -C builddir test
- ninja -C builddir install
artifacts:
expire_in: "7 days"
when: "always"
paths:
- 'builddir/meson-logs/'
# Based on https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/.gitlab-ci.yml (.build windows)
.build meson windows:
image: $WINDOWS_IMAGE
stage: 'build'
tags:
- 'docker'
- 'windows'
- '1809'
timeout: '30min'
variables:
MESON_ARGS: >
${DEFAULT_MESON_ARGS}
-Dfontconfig=enabled
-Dfreetype=enabled
-Dglib=enabled
-Dzlib=enabled
before_script:
# Make sure meson is up to date, so we don't need to rebuild the image with each release
- pip3 install -U meson
script:
# Make sure powershell exists on errors
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
- $ErrorActionPreference = "Stop"
# Copy GLib from existing subproject cache to avoid downloading it
- cd $env:CI_PROJECT_DIR
- cp -r C:/subprojects/glib subprojects/
# For some reason, options are separated by newline instead of space, so we
# have to replace them first.
- $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
# Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
# Environment variables substitutions is done by PowerShell before calling
# cmd.exe, that's why we use $env:FOO instead of %FOO%
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
meson subprojects update --reset &&
meson build $env:MESON_ARGS &&
ninja -C build"
meson vs2017 amd64:
extends: '.build meson windows'
variables:
ARCH: 'amd64'
when: 'manual'
meson vs2017 x86:
extends: '.build meson windows'
variables:
ARCH: 'x86'
when: 'manual'
meson android arm64 fedora:
# TODO: should probably build our own image here some day
# See https://gitlab.freedesktop.org/gstreamer/gstreamer/container_registry/7689 for current images
image: 'registry.freedesktop.org/gstreamer/gstreamer/amd64/android-fedora:2020-10-22.0-master'
stage: 'build'
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
expire_in: '5 days'
when: 'always'
paths:
- "build/meson-logs/*.txt"
before_script:
- dnf install -y python3-pip gcc ninja-build gperf
- pip3 install --user meson
script:
- export PATH="$HOME/.local/bin:$PATH"
- |
cat > android-cross-file.txt <<EOF
[constants]
ndk_path = '/android/ndk'
toolchain = ndk_path + '/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android'
api = '28'
[host_machine]
system = 'android'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
[properties]
sys_root = ndk_path + '/sysroot'
c_link_args = ['-fuse-ld=gold']
cpp_link_args = ['-fuse-ld=gold']
[binaries]
c = toolchain + api + '-clang'
cpp = toolchain + api + '-clang++'
ar = toolchain + '-ar'
strip = toolchain + '-strip'
EOF
- meson setup --cross-file android-cross-file.txt -Dpixman:a64-neon=disabled build
- meson compile --verbose -C build
meson macOS:
tags:
- gst-macos-11.1
stage: 'build'
artifacts:
when: 'always'
expire_in: "7 days"
paths:
- build/meson-logs/*.txt
- build/meson-private/*.pc
- build/test/*.log
- build/test/pdiff/*.log
- build/test/output
exclude:
- "build/test/**/*.cs"
- "build/test/**/*.trace"
before_script:
# Install the DejaVu fonts
- curl -LO https://downloads.sourceforge.net/dejavu/dejavu-fonts-ttf-2.37.zip
- unzip dejavu-fonts-ttf-2.37.zip
- cp dejavu-fonts-ttf-2.37/ttf/*.ttf /Library/Fonts
# Update pip
- pip3 install --upgrade pip
# Make sure meson is up to date
- pip3 install -U meson
# Need to install certificates for Python
- pip3 install --upgrade certifi
# Anther way to install certificates
- open /Applications/Python\ 3.8/Install\ Certificates.command
# Get ninja
- pip3 install -U ninja
script:
- CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
# pixman region-test fails to link on macOS
- meson setup -Dpixman:tests=disabled build
- meson compile --verbose -C build
# Test cairo-quartz. Other backends should be covered by other jobs
- export CAIRO_TEST_IGNORE_quartz_argb32=$(tr '\n' ',' < .gitlab-ci/ignore-quartz-argb32.txt)
- export CAIRO_TEST_IGNORE_quartz_rgb24=$(tr '\n' ',' < .gitlab-ci/ignore-quartz-rgb24.txt)
- export CAIRO_TEST_TARGET=quartz
- (cd build/test && srcdir=../../test ./cairo-test-suite)