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