gitlab-ci: update meson invocations
[mesa-waffle.git] / .gitlab-ci.yml
blob5f44f0d003fb294151c5e7710a42963199b0323b
1 variables:
2   FDO_UPSTREAM_REPO: mesa/waffle
3   FDO_DISTRIBUTION_TAG: '2022-09-13'
4   FDO_DISTRIBUTION_VERSION: 'bullseye-slim'
6 include:
7   - project: 'freedesktop/ci-templates'
8     ref: &ci-templates-sha 52dd4a94044449c8481d18dcdc221a3c636366d2
9     file: '/templates/debian.yml'
11 workflow:
12   rules:
13     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
14     - if: $CI_PIPELINE_SOURCE == 'push'
16 stages:
17   - container
18   - style-check
19   - build
20   - www
22 # When to automatically run the CI
23 .ci-run-policy:
24   retry:
25     max: 2
26     when:
27       - runner_system_failure
28   # Cancel CI run if a newer commit is pushed to the same branch
29   interruptible: true
31 container:
32   stage: container
33   extends:
34     - .fdo.container-build@debian
35     - .ci-run-policy
36   variables:
37     # no need to pull the whole repo to build the container image
38     GIT_STRATEGY: none
40     # clang-format requires git, yet it's missing in the packaging
41     FDO_DISTRIBUTION_PACKAGES: >
42       bash-completion
43       ca-certificates
44       clang-format
45       cmake
46       docbook-xsl
47       docbook-xml
48       g++
49       gcc
50       git
51       libcmocka-dev
52       libdrm-dev
53       libegl-dev
54       libgbm-dev
55       libgl-dev
56       libgles-dev
57       libglx-dev
58       libwayland-dev
59       libx11-xcb-dev
60       make
61       meson
62       mingw-w64
63       pkg-config
64       wayland-protocols
65       xauth
66       xsltproc
67       xvfb
69 clang-format:
70   extends:
71     - .ci-run-policy
72     - .fdo.container-build@debian
73   stage: style-check
74   variables:
75     GIT_DEPTH: 100
76   image: "$CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG"
77   needs:
78     - container
79   script:
80     - .gitlab-ci/clang-format.sh
82 # BUILD
83 .build:
84   extends:
85     - .ci-run-policy
86     - .fdo.container-build@debian
87   stage: build
88   variables:
89     GIT_DEPTH: 100
90   image: "$CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG"
91   needs:
92     - container
95 meson:
96   extends:
97     - .build
98   script:
99     - bash .gitlab-ci/build-meson.sh x11
100     - bash .gitlab-ci/build-meson.sh wayland
101     - bash .gitlab-ci/build-meson.sh gbm
102     - bash .gitlab-ci/build-meson.sh surfaceless
103   artifacts:
104     when: on_failure
105     paths:
106       - _build/meson-logs/*.txt
108 cmake:
109   extends:
110     - .build
111   script:
112     - cmake
113         -S . -B _build
114         -DCMAKE_INSTALL_PREFIX=`pwd`/install
115         -DCMAKE_BUILD_TYPE=Debug
116         -Dwaffle_enable_deprecated_build=1
117         -Dwaffle_has_gbm=1
118         -Dwaffle_has_glx=1
119         -Dwaffle_has_x11_egl=1
120         -Dwaffle_has_wayland=1
121         -Dwaffle_has_surfaceless=1
122         -Dwaffle_build_manpages=1
123         -Dwaffle_build_htmldocs=1
124         -Dwaffle_build_examples=1
125     - make -C _build -j4
126     - make -C _build check
127     - make -C _build install
129 cmake-mingw:
130   extends:
131     - .build
132   script:
133     - .gitlab-ci/build-cmake-mingw.sh
134   # TODO: Only create artifacts on certain builds.  See also:
135   # - https://docs.gitlab.com/ee/ci/yaml/README.html#artifactspaths
136   # - https://docs.gitlab.com/ee/ci/yaml/README.html#complete-example-for-release
137   artifacts:
138     paths:
139       - publish/*/waffle-*.zip
141 pages:
142   stage: www
143   image: alpine
144   script:
145   - apk add --no-cache git git-lfs
146   - git lfs install
147   - mkdir public
148   - git checkout origin/tarballs
149   - git log --oneline -1
150   - cp -r files public
151   - git checkout origin/master
152   - git log --oneline -1
153   - cp -r www/* public
154   - cp -r doc/release-notes public/files
155   artifacts:
156     paths:
157     - public
158   only:
159     refs:
160       - master
161     changes:
162       - .gitlab-ci.yml
163       - doc/release-notes/**/*
164       - www/**/*