summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: a388375bd75274b167dd4371b253f6446c8cea7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
variables:
  FDO_UPSTREAM_REPO: mesa/demos

include:
  - project: 'freedesktop/ci-templates'
    ref: 3f37cc0e461f5b0c815409bf6f55759f26a74e9c
    file: '/templates/debian.yml'

stages:
  - container
  - build

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_PIPELINE_SOURCE == 'push'

# When & how to run the CI
.ci-run-policy:
  retry:
    max: 2
    when:
      - runner_system_failure
  # Cancel CI run if a newer commit is pushed to the same branch
  interruptible: true


# CONTAINERS

# Debian 11 based x86 build image
x86_build:
  stage: container
  extends:
    - .fdo.container-build@debian
    - .ci-run-policy
  variables:
    FDO_DISTRIBUTION_VERSION: bullseye-slim
    FDO_REPO_SUFFIX: "debian/$CI_JOB_NAME"
    # No need to pull the whole repo to build the container image
    GIT_STRATEGY: none
    # /!\ Bump the TAG when modifying the DEBS
    FDO_DISTRIBUTION_TAG: &x86_build "2023-02-17-clang"
    FDO_DISTRIBUTION_PACKAGES: >-
      build-essential
      clang
      python3-pip
      pkg-config
      ninja-build
      git
      glslang-tools
      mingw-w64
      mingw-w64-tools
      wine

      freeglut3-dev
      libcairo2-dev
      libdbus-1-dev
      libdrm-dev
      libegl-dev
      libgbm-dev
      libgl-dev
      libgles-dev
      libosmesa6-dev
      libpango1.0-dev
      libpangocairo-1.0-0
      libudev-dev
      libvulkan-dev
      libwayland-dev
      libwayland-cursor0
      libx11-dev
      libxcb1-dev
      libxkbcommon-dev
      libxkbcommon-x11-dev
      wayland-protocols
    FDO_DISTRIBUTION_EXEC: pip3 install meson==0.59.4

.use-x86_build:
  variables:
    TAG: *x86_build
  image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG"
  needs:
    - x86_build


# BUILD

.build:
  stage: build
  extends:
    - .ci-run-policy
  variables:
    GIT_DEPTH: 10
  script:
    - meson _build
      --prefix $PWD/install
      --buildtype debug
      ${EXTRA_OPTION}
    - ninja -C _build -j${FDO_CI_CONCURRENT:-4}
    - ninja -C _build install

.build-linux:
  extends:
    - .use-x86_build
    - .build
  variables:
    EXTRA_OPTION: >
      -Dauto_features=enabled
      -Dlibdecor-0:gtk=disabled
      -Dlibdecor-0:demo=false

build-gcc:
  extends:
    - .build-linux

build-clang:
  extends:
    - .build-linux
  variables:
    CC: clang
    CXX: clang++

build-mingw:
  extends:
    - .use-x86_build
    - .build
  before_script:
    - .gitlab-ci/prepare-glut-mingw.sh
  variables:
    EXTRA_OPTION: >
      --cross-file=.gitlab-ci/x86_64-w64-mingw32
      -Dglut=enabled