.gitlab-ci.yml 4.14 KB
Newer Older
1
# -*- indent-tabs-mode: nil -*-
2
3
include:
  - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
4
5
6
  - project: 'freedesktop/ci-templates'
    ref: '88ed1082df2af02090916566742543f1dbaee988'
    file: '/templates/fedora.yml'
7
8

variables:
9
10
11
  FDO_UPSTREAM_REPO: 'cairo/cairo'
  FDO_DISTRIBUTION_VERSION: '32'
  FDO_DISTRIBUTION_TAG: '2020-09-29.0'
12

13
14
15
16
17
  # TODO: should probably get its own image at some point instead of reusing the GStreamer one.
  WINDOWS_IMAGE:             "registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v12-master"

  DEFAULT_MESON_ARGS: >
    --default-library=both
18
19
20
    -Dgl-backend=auto
    -Dglesv2=auto
    -Dglesv2=auto
21
22

stages:
23
  - prep
24
25
  - test

26
27
28
29
30
31
32
33
34
35
36
# 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

37
38
39
40
41
42
.ccache_setup:
  variables:
    CCACHE_BASEDIR: "$CI_PROJECT_DIR"
    CCACHE_DIR: "$CI_PROJECT_DIR/ccache"
    CC: "ccache gcc"
    CXX: "ccache g++"
43
44
  before_script:
    - mkdir -p ccache
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    - 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
      libpng-devel
      fontconfig-devel
      freetype-devel
      libX11-devel
      libXrender-devel
      glib2-devel
      librsvg2-devel
      libdrm-devel
      poppler-glib-devel
      pixman-devel
      cogl-devel
      systemd-devel
      systemd-udev
      mesa-libEGL
      mesa-libGL
      mesa-libGL-devel
      mesa-libgbm
      mesa-libgbm-devel
      mesa-libglapi
      autoconf
      automake
      make
      which
      libtool
      diffutils
90

91
92
93
94
95
fedora autotools build:
  extends:
    - '.fdo.distribution-image@fedora'
    - '.ccache_setup'
  stage: 'test'
96
97
  script:
    - ./autogen.sh
98
99
    # Ignore test suite failures with CAIRO_TEST_FORCE_PASS=1
    - make check CAIRO_TEST_FORCE_PASS=1 VERBOSE=1
100
  artifacts:
101
102
    when: 'always'
    expire_in: "7 days"
103
104
105
106
107
    paths:
      - test/*.log
      - test/pdiff/*.log
      - test/output

108
109
110
111
112
113
114
115
116
117
118
119
120
fedora meson build:
  extends:
    - '.fdo.distribution-image@fedora'
    - '.ccache_setup'
  stage: 'test'
  script:
    - meson builddir
    - ninja -C builddir
    # - ninja -C builddir test
    - ninja -C builddir install
  artifacts:
    expire_in: "7 days"
    when: "always"
121
    paths:
122
      - 'builddir/meson-logs/'
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

# Based on https://gitlab.freedesktop.org/gstreamer/gst-ci/-/blob/master/gitlab/ci_template.yml
.build meson windows:
  image: $WINDOWS_IMAGE
  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 build $env:MESON_ARGS &&
        ninja -C build"

meson vs2017 amd64:
  extends: '.build meson windows'
  variables:
    ARCH: 'amd64'

meson vs2017 x86:
  extends: '.build meson windows'
  variables:
    ARCH: 'x86'