arb_occlusion_query: execute test even if no query bits
[piglit.git] / .gitlab-ci.yml
blob2c5fc45862a45174bf551f7d5bd0cdbe4a75846d
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.
10 variables:
11   FDO_UPSTREAM_REPO: mesa/piglit
12   FDO_DISTRIBUTION_TAG: "2022-12-08-where-is-the-mako"
13   FDO_DISTRIBUTION_VERSION: bullseye-slim
14   WINDOWS_TAG: "2022-07-27-win2022"
15   WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/windows/x64_build:$WINDOWS_TAG"
16   WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$UPSTREAM_REPO/windows/x64_build:$WINDOWS_TAG"
17   GIT_DEPTH: 100
19 include:
20   - project: 'freedesktop/ci-templates'
21     ref: ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
22     file: '/templates/debian.yml'
24 stages:
25   - container
26   - check
27   - build
28   - deploy
31 # When & how to run the CI
32 .ci-run-policy:
33   retry:
34     max: 2
35     when:
36       - runner_system_failure
37   # Cancel CI run if a newer commit is pushed to the same branch
38   interruptible: true
40 # CONTAINERS
42 debian:
43   stage: container
44   extends:
45     - .ci-run-policy
46     - .fdo.container-build@debian
47   variables:
48     GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
49     FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/debian-install.sh'
51 .use-debian:
52   extends:
53     - .ci-run-policy
54     - .fdo.distribution-image@debian
55   needs: [debian]
57 windows:
58   stage: container
59   extends:
60     - .ci-run-policy
61   variables:
62     GIT_STRATEGY: fetch # we do actually need the full repository though
63   timeout: 3h
64   tags:
65     - windows
66     - shell
67     - "2022"
68   script:
69     - .\.gitlab-ci\windows\container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE
71 .use-windows:
72   extends:
73     - .ci-run-policy
74   tags:
75     - windows
76     - docker
77     - "2022"
78   needs: [windows]
79   image: $WINDOWS_IMAGE
81 # CHECK
82 linting:
83   stage: check
84   extends:
85     - .use-debian
86   script:
87     - codespell -f -S ".mypy_cache" -L "lod,LOD,inout,nd,ND,valu,VALU,tese,ba,te,nin"
88     - export CHECKPATH=framework/replay # restrict Python checks only on framework/replay for now
89     - isort --check-only $CHECKPATH
90     - flake8 --max-line-length=120 --show-source $CHECKPATH
91     - mypy --ignore-missing-imports --disallow-incomplete-defs $CHECKPATH
92     - pylint --fail-under=8.5 $CHECKPATH
95 # BUILD
97 # Use ccache transparently, and print stats before/after
98 .use-ccache:
99   variables:
100     CC: /usr/lib/ccache/gcc
101     CXX: /usr/lib/ccache/g++
102     CCACHE_COMPILERCHECK: content
103     CCACHE_DIR: /cache/piglit/ccache
104   before_script:
105     - export CCACHE_BASEDIR="$PWD"
106     - ccache --show-stats
107   after_script:
108     - ccache --show-stats
110 build-debian:
111   stage: build
112   extends:
113     - .use-debian
114     - .use-ccache
115   script:
116     - .gitlab-ci/build-debian.sh
117   artifacts:
118     when: on_failure
119     paths:
120       - CMakeCache.txt
121       - CMakeFiles/*.log
123 build-debian-mingw:
124   stage: build
125   extends:
126     - .use-debian
127     - .use-ccache
128   parallel:
129     matrix:
130       - TARGET: [mingw32, mingw64]
131   script:
132     - .gitlab-ci/build-mingw.sh ${TARGET}
133   artifacts:
134     paths:
135       - build/*/piglit-*.7z
137 build-windows:
138   stage: build
139   extends:
140     - .use-windows
141   script:
142     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 &&
143       cmake . -D CMAKE_BUILD_TYPE=Debug
144       -D PIGLIT_BUILD_CL_TESTS=off
145       -D GLUT_INCLUDE_DIR=C:\freeglut\include
146       -D GLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib
147       -D GLEXT_INCLUDE_DIR=C:\glext\
148       -D PIGLIT_BUILD_DMA_BUF_TESTS=off
149       -D PIGLIT_BUILD_GLES1_TESTS=off
150       -D PIGLIT_BUILD_GLES2_TESTS=off
151       -D PIGLIT_BUILD_GLX_TESTS=off
152       -D PIGLIT_BUILD_GL_TESTS=on
153       -D PIGLIT_BUILD_WGL_TESTS=on
154       -GNinja &&
155       ninja -j4"
157 py.test:
158   stage: build
159   extends:
160     - .use-debian
161   script:
162     - pytest-3 unittests/framework
164 tox:
165   image: python:${PY_MAJVER}.${PY_MINVER}
166   stage: build
167   extends:
168     - .ci-run-policy
169   before_script:
170     - pip install tox==3.27.1  # 4.0 is broken for now
171   script:
172     - tox -e "py${PY_MAJVER}${PY_MINVER}-{generator,noaccel,accel-nix,streams,functional}"
173   parallel:
174     matrix:
175       - PY_MAJVER: 3
176         PY_MINVER: [7, 8, 9, 10]
177   needs: []
179 pages:
180   stage: deploy
181   image: alpine
182   script:
183   - apk --no-cache add py3-pip python3
184   - pip install sphinx
185   - pip install Flask-Sphinx-Themes
186   - cd docs
187   - ./build-html.sh
188   - mv _build/html/ ../public/
189   artifacts:
190     paths:
191     - public
192   only:
193     refs:
194       - main
195     changes:
196       - docs/**