1.test: 2 # Cancel job if a newer commit is pushed to the same branch 3 interruptible: true 4 variables: 5 GIT_STRATEGY: none # testing doesn't build anything from source 6 before_script: 7 - !reference [default, before_script] 8 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY 9 - rm -rf install 10 - tar -xf artifacts/install.tar 11 - section_start ldd_section "Checking ldd on driver build" 12 - LD_LIBRARY_PATH=install/lib find install/lib -name "*.so" -print -exec ldd {} \; 13 - section_end ldd_section 14 artifacts: 15 when: always 16 name: "mesa_${CI_JOB_NAME}" 17 paths: 18 - results/ 19 rules: 20 - !reference [.common-rules, rules] 21 - !reference [.never-post-merge-rules, rules] 22 23.formatting-check: 24 # Cancel job if a newer commit is pushed to the same branch 25 interruptible: true 26 stage: code-validation 27 extends: 28 - .use-debian/x86_64_build 29 variables: 30 GIT_STRATEGY: fetch 31 timeout: 10m 32 script: 33 - git diff --color=always --exit-code # Fails if there are diffs 34 tags: 35 - placeholder-job 36 37rustfmt: 38 extends: 39 - .formatting-check 40 - .lint-rustfmt-rules 41 before_script: 42 - shopt -s globstar 43 - rustfmt --version 44 - rustfmt --verbose src/**/lib.rs 45 46yaml-toml-shell-py-test: 47 extends: 48 - .use-debian/x86_64_pyutils 49 - .no-auto-retry # this job can't be flaky 50 stage: code-validation 51 script: 52 - uncollapsed_section_start tomllint "tomllint" 53 - echo "If your change looks right but this script rejects it, contact @eric (GitLab) / eric_engestrom (IRC)." 54 - python3 bin/toml_lint.py 55 - section_end tomllint 56 - section_start yamllint "yamllint" 57 - .gitlab-ci/run-yamllint.sh 58 - section_end yamllint 59 - section_start shellcheck "shellcheck" 60 - .gitlab-ci/run-shellcheck.sh 61 - section_end shellcheck 62 - .gitlab-ci/run-pytest.sh 63 rules: 64 - !reference [.disable-farm-mr-rules, rules] 65 - !reference [.never-post-merge-rules, rules] 66 - !reference [.no_scheduled_pipelines-rules, rules] 67 - if: $GITLAB_USER_LOGIN == "marge-bot" 68 changes: &lint_files 69 - .gitlab-ci/test/gitlab-ci.yml 70 - .gitlab-ci/**/*.sh 71 - .shellcheckrc 72 - bin/toml_lint.py 73 - src/**/ci/*.toml 74 - .gitlab-ci/tests/**/* 75 - bin/ci/**/* 76 when: on_success 77 - changes: *lint_files 78 when: manual 79 tags: 80 - placeholder-job 81 82.test-gl: 83 extends: 84 - .test 85 - .use-debian/x86_64_test-gl 86 needs: 87 - debian/x86_64_test-gl 88 - debian-testing 89 - !reference [.required-for-hardware-jobs, needs] 90 variables: 91 DEBIAN_ARCH: amd64 92 93.test-vk: 94 extends: 95 - .test 96 - .use-debian/x86_64_test-vk 97 needs: 98 - debian-testing 99 - debian/x86_64_test-vk 100 - !reference [.required-for-hardware-jobs, needs] 101 variables: 102 DEBIAN_ARCH: amd64 103 104.test-cl: 105 extends: 106 - .test 107 - .use-debian/x86_64_test-gl 108 needs: 109 - debian/x86_64_test-gl 110 - !reference [.required-for-hardware-jobs, needs] 111 112.test-android: 113 extends: 114 - .test 115 - .use-debian/x86_64_test-android 116 variables: 117 # This is for the guest artifacts from debian-android which will be 118 # downloaded explicitly by cuttlefish-runner.sh 119 S3_ANDROID_ARTIFACT_NAME: mesa-x86_64-android-debug 120 needs: 121 - job: debian-testing 122 artifacts: true # On the host we want the Linux build 123 - job: debian-android 124 artifacts: false # The Android build will be downloaded later 125 - job: debian/x86_64_test-android 126 artifacts: false 127 - !reference [.required-for-hardware-jobs, needs] 128 timeout: 20m 129 script: 130 - ./install/cuttlefish-runner.sh 131 artifacts: 132 paths: 133 - results/ 134 135.b2c-vkd3d-proton-test: 136 variables: 137 HWCI_TEST_SCRIPT: install/vkd3d-runner.sh 138 139.piglit-traces-test: 140 artifacts: 141 when: on_failure 142 name: "mesa_${CI_JOB_NAME}" 143 reports: 144 junit: results/junit.xml 145 paths: 146 - results/ 147 exclude: 148 - results/*.shader_cache 149 variables: 150 # until we overcome Infrastructure issues, give traces extra 5 min before timeout 151 DEVICE_HANGING_TIMEOUT_SEC: 600 152 PIGLIT_REPLAY_EXTRA_ARGS: --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=${S3_TRACIE_PUBLIC_BUCKET} --jwt-file=${S3_JWT_FILE} 153 PIGLIT_NO_WINDOW: 1 154 HWCI_TEST_SCRIPT: "/install/piglit/piglit-runner.sh" 155 script: 156 - section_start variables "Variables passed through:" 157 - install/common/generate-env.sh 158 - section_end variables 159 - install/piglit/piglit-traces.sh 160 161.deqp-test: 162 script: 163 - rm -rf results # Clear out old results if the docker container was cached 164 - ./install/deqp-runner.sh 165 artifacts: 166 exclude: 167 - results/*.shader_cache 168 reports: 169 junit: results/junit.xml 170 171.fossilize-test: 172 script: 173 - ./install/fossilize-runner.sh 174 artifacts: 175 when: on_failure 176 name: "mesa_${CI_JOB_NAME}" 177 paths: 178 - results/ 179 180.download_s3: 181 before_script: 182 - !reference [default, before_script] 183 # Use this instead of gitlab's artifacts download because it hits packet.net 184 # instead of fd.o. Set FDO_HTTP_CACHE_URI to an http cache for your test lab to 185 # improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for 186 # setup). 187 - section_start artifacts_download "Downloading artifacts from s3" 188 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY 189 - rm -rf install 190 - (set -x; curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}.tar.zst | tar --zstd -x) 191 - section_end artifacts_download 192 193.baremetal-test: 194 extends: 195 - .test 196 # Cancel job if a newer commit is pushed to the same branch 197 interruptible: true 198 before_script: 199 - !reference [.download_s3, before_script] 200 variables: 201 BM_ROOTFS: /rootfs-${DEBIAN_ARCH} 202 artifacts: 203 when: always 204 name: "mesa_${CI_JOB_NAME}" 205 paths: 206 - results/ 207 - serial*.txt 208 exclude: 209 - results/*.shader_cache 210 reports: 211 junit: results/junit.xml 212 213# ARM testing of bare-metal boards attached to an x86 gitlab-runner system 214.baremetal-test-arm32: 215 extends: 216 - .baremetal-test 217 - .use-debian/baremetal_arm32_test 218 variables: 219 DEBIAN_ARCH: armhf 220 S3_ARTIFACT_NAME: mesa-arm32-default-debugoptimized 221 needs: 222 - debian/baremetal_arm32_test 223 - job: debian-arm32 224 artifacts: false 225 - !reference [.required-for-hardware-jobs, needs] 226 227# ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system 228.baremetal-test-arm64: 229 extends: 230 - .baremetal-test 231 - .use-debian/baremetal_arm64_test 232 variables: 233 DEBIAN_ARCH: arm64 234 S3_ARTIFACT_NAME: mesa-arm64-default-debugoptimized 235 needs: 236 - debian/baremetal_arm64_test 237 - job: debian-arm64 238 artifacts: false 239 - !reference [.required-for-hardware-jobs, needs] 240 241# ARM32/64 testing of bare-metal boards attached to an x86 gitlab-runner system, using an asan mesa build 242.baremetal-arm32-asan-test: 243 variables: 244 S3_ARTIFACT_NAME: mesa-arm32-asan-debugoptimized 245 DEQP_FORCE_ASAN: 1 246 needs: 247 - debian/baremetal_arm32_test 248 - job: debian-arm32-asan 249 artifacts: false 250 - !reference [.required-for-hardware-jobs, needs] 251 252.baremetal-arm64-asan-test: 253 variables: 254 S3_ARTIFACT_NAME: mesa-arm64-asan-debugoptimized 255 DEQP_FORCE_ASAN: 1 256 needs: 257 - debian/baremetal_arm64_test 258 - job: debian-arm64-asan 259 artifacts: false 260 - !reference [.required-for-hardware-jobs, needs] 261 262.baremetal-arm64-ubsan-test: 263 extends: 264 - .baremetal-test 265 - .use-debian/baremetal_arm64_test 266 variables: 267 S3_ARTIFACT_NAME: mesa-arm64-ubsan-debugoptimized 268 needs: 269 - debian/baremetal_arm64_test 270 - job: debian-arm64-ubsan 271 artifacts: false 272 - !reference [.required-for-hardware-jobs, needs] 273 274.baremetal-deqp-test: 275 variables: 276 HWCI_TEST_SCRIPT: "/install/deqp-runner.sh" 277 FDO_CI_CONCURRENT: 0 # Default to number of CPUs 278 279# For Valve's bare-metal testing farm jobs. 280.b2c-test: 281 # It would be nice to use ci-templates within Mesa CI for this job's 282 # image:, but the integration is not possible for the current 283 # use-case. Within this job, two containers are managed. 1) the 284 # gitlab runner container from which the job is submitted to the 285 # DUT, and 2) the test container (e.g. debian/x86_64_test-vk) within 286 # which the test cases will run on the DUT. Since ci-templates and 287 # the associated image setting macros in this file rely on variables 288 # like FDO_DISTRIBUTION_TAG for *the* image, there is no way to 289 # depend on more than one image per job. So, the job container is 290 # built as part of the CI in the boot2container project. 291 image: registry.freedesktop.org/gfx-ci/ci-tron/mesa-trigger:2024-01-05.1 292 timeout: 1h 40m 293 variables: 294 # No need by default to pull the whole repo 295 GIT_STRATEGY: none 296 # boot2container initrd configuration parameters. 297 B2C_VERSION: v0.9.14 298 B2C_JOB_SUCCESS_REGEX: 'hwci: mesa: pass, exit_code: 0\r$' 299 B2C_LOG_LEVEL: 6 300 B2C_POWEROFF_DELAY: 15 301 B2C_SESSION_END_REGEX: '^.*It''s now safe to turn off your computer\r$' 302 B2C_SESSION_REBOOT_REGEX: '' 303 B2C_TIMEOUT_BOOT_MINUTES: 45 304 B2C_TIMEOUT_BOOT_RETRIES: 0 305 B2C_TIMEOUT_FIRST_CONSOLE_ACTIVITY_MINUTES: 2 306 B2C_TIMEOUT_FIRST_CONSOLE_ACTIVITY_RETRIES: 3 307 B2C_TIMEOUT_CONSOLE_ACTIVITY_MINUTES: 5 308 B2C_TIMEOUT_OVERALL_MINUTES: 90 309 B2C_TIMEOUT_CONSOLE_ACTIVITY_RETRIES: 0 310 B2C_JOB_VOLUME_EXCLUSIONS: "*.shader_cache,install/*,*/install/*,*/vkd3d-proton.cache*,vkd3d-proton.cache*,*.qpa" 311 312 # As noted in the top description, we make a distinction between the 313 # container used by gitlab-runner to queue the work, and the container 314 # used by the DUTs/test machines. To make this distinction quite clear, 315 # we rename the MESA_IMAGE variable into IMAGE_UNDER_TEST. 316 IMAGE_UNDER_TEST: "$MESA_IMAGE" 317 318 INSTALL_TARBALL_NAME: "install.tar" 319 INSTALL_TARBALL: "./artifacts/${INSTALL_TARBALL_NAME}" 320 CI_B2C_ARTIFACTS: "./artifacts/b2c" 321 CI_COMMON_SCRIPTS: "./artifacts/ci-common" 322 B2C_JOB_TEMPLATE: "${CI_B2C_ARTIFACTS}/b2c.yml.jinja2.jinja2" 323 JOB_FOLDER: "job_folder" 324 325 before_script: 326 # We don't want the tarball unpacking of .test, but will take the JWT bits. 327 - !reference [default, before_script] 328 329 - | 330 set -eux 331 332 section_start b2c_kernel_boot "Booting hardware device" 333 334 # Useful as a hook point for runner admins. You may edit the 335 # config.toml for the Gitlab runner and use a bind-mount to 336 # populate the hook script with some executable commands. This 337 # allows quicker feedback than resubmitting pipelines and 338 # potentially having to wait for a debug build of Mesa to 339 # complete. 340 if [ -x /runner-before-script.sh ]; then 341 echo "Executing runner before-script hook..." 342 sh /runner-before-script.sh 343 if [ $? -ne 0 ]; then 344 echo "Runner hook failed, goodbye" 345 exit $? 346 fi 347 fi 348 349 [ -s "$INSTALL_TARBALL" ] || exit 1 350 [ -d "$CI_B2C_ARTIFACTS" ] || exit 1 351 [ -d "$CI_COMMON_SCRIPTS" ] || exit 1 352 353 export B2C_CONTAINER_CMD="bash -euc 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'" 354 355 # The Valve CI gateway receives jobs in a YAML format. Create a 356 # job description from the CI environment. 357 python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py 358 359 cat b2c.yml.jinja2 360 361 rm -rf ${JOB_FOLDER} || true 362 mkdir -v ${JOB_FOLDER} 363 364 # Create a script to regenerate the CI environment when this job 365 # begins running on the remote DUT. 366 set +x 367 "$CI_COMMON_SCRIPTS"/generate-env.sh > ${JOB_FOLDER}/set-job-env-vars.sh 368 echo "export SCRIPTS_DIR=./install" >> ${JOB_FOLDER}/set-job-env-vars.sh 369 echo "Variables passed through:" 370 cat ${JOB_FOLDER}/set-job-env-vars.sh 371 set -x 372 373 # Copy the mesa install tarball to the job folder, for later extraction 374 mv "${INSTALL_TARBALL}" "${JOB_FOLDER}" 375 376 script: | 377 slugify () { 378 echo "$1" | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z 379 } 380 381 # Submit the job to Valve's CI gateway service with the CI 382 # provisioned job_folder. 383 env PYTHONUNBUFFERED=1 executorctl \ 384 run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER} -i "$CI_RUNNER_DESCRIPTION" 385 386 # Anything our job places in results/ will be collected by the 387 # Gitlab coordinator for status presentation. results/junit.xml 388 # will be parsed by the UI for more detailed explanations of 389 # test execution. 390 after_script: 391 # Keep the results path the same as baremetal and LAVA 392 - mkdir -p "${JOB_FOLDER}"/results 393 - mv "${JOB_FOLDER}"/results ./ 394 - !reference [default, after_script] 395 396 artifacts: 397 when: always 398 name: "mesa_${CI_JOB_NAME}" 399 paths: 400 - results 401 reports: 402 junit: results/**/junit.xml 403 404.b2c-x86_64-test: 405 extends: 406 - .b2c-test 407 variables: 408 B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/gfx-ci/ci-tron/-/package_files/519/download' # Linux 6.1 409 B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/gfx-ci/boot2container/-/releases/${B2C_VERSION}/downloads/initramfs.linux_amd64.cpio.xz' 410 411.b2c-x86_64-test-vk: 412 extends: 413 - .use-debian/x86_64_test-vk 414 - .b2c-x86_64-test 415 needs: 416 - debian/x86_64_test-vk 417 - debian-testing 418 - !reference [.required-for-hardware-jobs, needs] 419 420.b2c-x86_64-test-gl: 421 extends: 422 - .use-debian/x86_64_test-gl 423 - .b2c-x86_64-test 424 needs: 425 - debian/x86_64_test-gl 426 - debian-testing 427 - !reference [.required-for-hardware-jobs, needs] 428 429.b2c-arm64-test: 430 extends: 431 - .b2c-test 432 variables: 433 B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/gfx-ci/boot2container/-/releases/${B2C_VERSION}/downloads/initramfs.linux_arm64.cpio.xz' 434 B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/gfx-ci/boot2container/-/releases/${B2C_VERSION}/downloads/linux-arm64' 435 436.b2c-arm64-test-vk: 437 extends: 438 - .use-debian/arm64_test-vk 439 - .b2c-arm64-test 440 needs: 441 - debian/arm64_test-vk 442 - debian-arm64 443 - !reference [.required-for-hardware-jobs, needs] 444 445.b2c-arm64-test-gl: 446 extends: 447 - .use-debian/arm64_test-gl 448 - .b2c-arm64-test 449 needs: 450 - debian/arm64_test-gl 451 - debian-arm64 452 - !reference [.required-for-hardware-jobs, needs] 453