summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 3cd5356c62fc167b4bb26ea7606d02aa821a36b4 (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
variables:
  UPSTREAM_REPO: mesa/demos

include:
  - project: 'wayland/ci-templates'
    ref: f69acac60d5dde0410124fd5674764600821b7a6
    file: '/templates/debian.yml'

stages:
  - container
  - build


# 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 10 based x86 build image
x86_build:
  stage: container
  extends:
    - .debian@container-ifnot-exists
    - .ci-run-policy
  variables:
    DEBIAN_VERSION: buster-slim
    REPO_SUFFIX: $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
    DEBIAN_TAG: &x86_build "2021-03-23"
    DEBIAN_DEBS: >-
      build-essential
      autoconf
      automake
      libtool
      make
      pkg-config
      cmake
      ninja-build
      mingw-w64

      freeglut3-dev
      libegl1-mesa-dev
      libgbm-dev
      libgl1-mesa-dev
      libudev-dev
      libwayland-dev
      libx11-dev
      libxcb1-dev
.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

.cmake-build:
  extends:
    - .build
  script:
    - cmake -S . -B _build
      -DCMAKE_INSTALL_PREFIX=$PWD/install
      -DCMAKE_BUILD_TYPE=Debug
      -G Ninja
    - ninja -C _build -j4
    - ninja -C _build install

.autotools-build:
  extends:
    - .build
  script:
    - ./autogen.sh
    - make -j4
    - make check
    - DESTDIR=$PWD/install make install

cmake:
  extends:
    - .use-x86_build
    - .cmake-build

cmake-mingw:
  extends:
    - .use-x86_build
    - .build
  script:
    - .gitlab-ci/build-mingw.sh

autotools:
  extends:
    - .use-x86_build
    - .autotools-build