# This is the tag of the docker image used for the build jobs. If the # image doesn't exist yet, the containers stage generates it. # # In order to generate a new image, one should generally change the tag. # While removing the image from the registry would also work, that's not # recommended except for ephemeral images during development: Replacing # an image after a significant amount of time might pull in newer # versions of gcc/clang or other packages, which might break the build # with older commits using the same tag. variables: FDO_UPSTREAM_REPO: mesa/piglit FDO_DISTRIBUTION_TAG: "2024-04-16-wayland-protocols" FDO_DISTRIBUTION_VERSION: bullseye-slim WINDOWS_TAG: "2022-07-27-win2022" WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/windows/x64_build:$WINDOWS_TAG" WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/windows/x64_build:$WINDOWS_TAG" GIT_DEPTH: 100 workflow: rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'push' include: - project: 'freedesktop/ci-templates' ref: ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 file: '/templates/debian.yml' stages: - container - check - build - deploy # 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: stage: container extends: - .ci-run-policy - .fdo.container-build@debian variables: GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/debian-install.sh' .use-debian: extends: - .ci-run-policy - .fdo.distribution-image@debian needs: [debian] windows: stage: container extends: - .ci-run-policy variables: GIT_STRATEGY: fetch # we do actually need the full repository though timeout: 3h tags: - windows - shell - "2022" script: - .\.gitlab-ci\windows\container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE .use-windows: extends: - .ci-run-policy tags: - windows - docker - "2022" needs: [windows] image: $WINDOWS_IMAGE # CHECK linting: stage: check extends: - .use-debian script: - codespell -f -S ".mypy_cache,drm_fourcc.h" -L "lod,inout,nd,valu,tese,ba,te,nin,marge,stach" - export CHECKPATH=framework/replay # restrict Python checks only on framework/replay for now - isort --check-only $CHECKPATH - flake8 --max-line-length=120 --show-source $CHECKPATH - mypy --ignore-missing-imports --disallow-incomplete-defs $CHECKPATH - pylint --fail-under=8.5 $CHECKPATH # BUILD # Use ccache transparently, and print stats before/after .use-ccache: variables: CC: /usr/lib/ccache/gcc CXX: /usr/lib/ccache/g++ CCACHE_COMPILERCHECK: content CCACHE_DIR: /cache/piglit/ccache before_script: - export CCACHE_BASEDIR="$PWD" - ccache --show-stats after_script: - ccache --show-stats build-debian: stage: build extends: - .use-debian - .use-ccache script: - .gitlab-ci/build-debian.sh artifacts: when: on_failure paths: - CMakeCache.txt - CMakeFiles/*.log build-debian-mingw: stage: build extends: - .use-debian - .use-ccache parallel: matrix: - TARGET: [mingw32, mingw64] script: - .gitlab-ci/build-mingw.sh ${TARGET} artifacts: paths: - build/*/piglit-*.7z build-windows: stage: build extends: - .use-windows script: - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake . -D CMAKE_BUILD_TYPE=Debug -D PIGLIT_BUILD_CL_TESTS=off -D GLUT_INCLUDE_DIR=C:\freeglut\include -D GLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib -D GLEXT_INCLUDE_DIR=C:\glext\ -D PIGLIT_BUILD_DMA_BUF_TESTS=off -D PIGLIT_BUILD_GLES1_TESTS=off -D PIGLIT_BUILD_GLES2_TESTS=off -D PIGLIT_BUILD_GLX_TESTS=off -D PIGLIT_BUILD_GL_TESTS=on -D PIGLIT_BUILD_WGL_TESTS=on -GNinja && ninja -j4" py.test: stage: build extends: - .use-debian script: - pytest-3 unittests/framework tox: image: python:${PY_MAJVER}.${PY_MINVER} stage: build extends: - .ci-run-policy before_script: - pip install tox==4.4.6 script: - tox run -e "py${PY_MAJVER}${PY_MINVER}-generator, py${PY_MAJVER}${PY_MINVER}-noaccel, py${PY_MAJVER}${PY_MINVER}-accel-nix, py${PY_MAJVER}${PY_MINVER}-streams, py${PY_MAJVER}${PY_MINVER}-functional" - test "$PY_MINVER" = "8" || tox run -e "py${PY_MAJVER}${PY_MINVER}-numpy2" # no numpy2 on Python 3.8 parallel: matrix: - PY_MAJVER: 3 PY_MINVER: [8, 9, 10, 11, 12] needs: [] pages: stage: deploy image: alpine script: - apk --no-cache add py3-pip python3 - pip install sphinx - pip install Flask-Sphinx-Themes - cd docs - ./build-html.sh - mv _build/html/ ../public/ artifacts: paths: - public only: refs: - main changes: - docs/**