summary: Add -g/--fixes to console-mode output
[piglit.git] / .gitlab-ci.yml
blobd3b7138fc1b3c5a8a6b986d25d54c6e1d34be03d
1 # This is the tag of the docker image used for the build jobs. If the
2 # image doesn't exist yet, the containers stage generates it.
4 # In order to generate a new image, one should generally change the tag.
5 # While removing the image from the registry would also work, that's not
6 # recommended except for ephemeral images during development: Replacing
7 # an image after a significant amount of time might pull in newer
8 # versions of gcc/clang or other packages, which might break the build
9 # with older commits using the same tag.
11 # After merging a change resulting in generating a new image to the
12 # main repository, it's recommended to remove the image from the source
13 # repository's container registry, so that the image from the main
14 # repository's registry will be used there as well.
15 variables:
16   UPSTREAM_REPO: mesa/piglit
17   DEBIAN_TAG: "2020-10-16"
18   DEBIAN_VERSION: buster-slim
19   DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
20   WINDOWS_TAG: "2020-08-18"
21   WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/windows/x64_build:$WINDOWS_TAG"
22   WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$UPSTREAM_REPO/windows/x64_build:$WINDOWS_TAG"
23   GIT_DEPTH: 100
25 include:
26   - project: 'wayland/ci-templates'
27     ref: b7030c2cd0d6ccc5f6d4f8299bafa4daa9240d71
28     file: '/templates/debian.yml'
30 stages:
31   - container
32   - build
33   - deploy
36 # When & how to run the CI
37 .ci-run-policy:
38   retry:
39     max: 2
40     when:
41       - runner_system_failure
42   # Cancel CI run if a newer commit is pushed to the same branch
43   interruptible: true
45 # CONTAINERS
47 debian:
48   stage: container
49   extends:
50     - .ci-run-policy
51     - .debian@container-ifnot-exists
52   variables:
53     GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
54     DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
55 .use-debian:
56   extends:
57     - .ci-run-policy
58   needs: [debian]
59   image: $DEBIAN_IMAGE
61 windows:
62   stage: container
63   extends:
64     - .ci-run-policy
65   variables:
66     GIT_STRATEGY: fetch # we do actually need the full repository though
67   timeout: 3h
68   tags:
69     - windows
70     - shell
71     - "1809"
72   script:
73     - .\.gitlab-ci\windows\container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE
75 .use-windows:
76   extends:
77     - .ci-run-policy
78   tags:
79     - windows
80     - docker
81     - "1809"
82   needs: [windows]
83   image: $WINDOWS_IMAGE
85 # BUILD
87 # Use ccache transparently, and print stats before/after
88 .use-ccache:
89   variables:
90     CC: /usr/lib/ccache/gcc
91     CXX: /usr/lib/ccache/g++
92     CCACHE_COMPILERCHECK: content
93     CCACHE_DIR: /cache/piglit/ccache
94   before_script:
95     - export CCACHE_BASEDIR="$PWD"
96     - ccache --show-stats
97   after_script:
98     - ccache --show-stats
100 build-debian:
101   stage: build
102   extends:
103     - .use-debian
104     - .use-ccache
105   script:
106     - cmake .
107       -D CMAKE_BUILD_TYPE=Debug
108       -D PIGLIT_BUILD_CL_TESTS=on
109       -D PIGLIT_BUILD_DMA_BUF_TESTS=on
110       -D PIGLIT_BUILD_GLES1_TESTS=on
111       -D PIGLIT_BUILD_GLES2_TESTS=on
112       -D PIGLIT_BUILD_GLX_TESTS=on
113       -D PIGLIT_BUILD_GL_TESTS=on
114       -D PIGLIT_BUILD_WGL_TESTS=off
115       -GNinja
116     - ninja -j4
118 build-windows:
119   stage: build
120   extends:
121     - .use-windows
122   script:
123     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 &&
124       cmake . -D CMAKE_BUILD_TYPE=Debug
125       -D PIGLIT_BUILD_CL_TESTS=off
126       -D GLUT_INCLUDE_DIR=C:\freeglut\include
127       -D GLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib
128       -D GLEXT_INCLUDE_DIR=C:\glext\
129       -D PIGLIT_BUILD_DMA_BUF_TESTS=off
130       -D PIGLIT_BUILD_GLES1_TESTS=off
131       -D PIGLIT_BUILD_GLES2_TESTS=off
132       -D PIGLIT_BUILD_GLX_TESTS=off
133       -D PIGLIT_BUILD_GL_TESTS=on
134       -D PIGLIT_BUILD_WGL_TESTS=on
135       -GNinja &&
136       ninja -j4"
138 py.test:
139   stage: build
140   extends:
141     - .use-debian
142   script:
143     - pytest-3 unittests/framework
145 tox:
146   image: python:${PY_MAJVER}.${PY_MINVER}
147   stage: build
148   extends:
149     - .ci-run-policy
150   before_script:
151     - pip install tox
152   script:
153     - tox -e "py${PY_MAJVER}${PY_MINVER}-{generator,noaccel,accel-nix,streams,functional}"
154   parallel:
155     matrix:
156       - PY_MAJVER: 3
157         PY_MINVER: [6, 7, 8]
158   needs: []
160 pages:
161   stage: deploy
162   image: alpine
163   script:
164   - apk --no-cache add py2-pip python-dev
165   - pip install sphinx
166   - pip install Flask-Sphinx-Themes
167   - cd docs
168   - ./build-html.sh
169   - mv _build/html/ ../public/
170   artifacts:
171     paths:
172     - public
173   only:
174     refs:
175       - master
176     changes:
177       - docs/**