build-igt.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. # SPDX-License-Identifier: MIT
  3. set -ex
  4. function generate_testlist {
  5. set +x
  6. while read -r line; do
  7. if [ "$line" = "TESTLIST" ] || [ "$line" = "END TESTLIST" ]; then
  8. continue
  9. fi
  10. tests=$(echo "$line" | tr ' ' '\n')
  11. for test in $tests; do
  12. output=$(/igt/libexec/igt-gpu-tools/"$test" --list-subtests || true)
  13. if [ -z "$output" ]; then
  14. echo "$test"
  15. else
  16. echo "$output" | while read -r subtest; do
  17. echo "$test@$subtest"
  18. done
  19. fi
  20. done
  21. done < /igt/libexec/igt-gpu-tools/test-list.txt > /igt/libexec/igt-gpu-tools/ci-testlist.txt
  22. set -x
  23. }
  24. git clone https://gitlab.freedesktop.org/drm/igt-gpu-tools.git --single-branch --no-checkout
  25. cd igt-gpu-tools
  26. git checkout $IGT_VERSION
  27. if [[ "$KERNEL_ARCH" = "arm" ]]; then
  28. . ../.gitlab-ci/container/create-cross-file.sh armhf
  29. EXTRA_MESON_ARGS="--cross-file /cross_file-armhf.txt"
  30. fi
  31. MESON_OPTIONS="-Doverlay=disabled \
  32. -Dchamelium=disabled \
  33. -Dvalgrind=disabled \
  34. -Dman=enabled \
  35. -Dtests=enabled \
  36. -Drunner=enabled \
  37. -Dlibunwind=enabled \
  38. -Dprefix=/igt"
  39. if [[ "$KERNEL_ARCH" = "arm64" ]] || [[ "$KERNEL_ARCH" = "arm" ]]; then
  40. MESON_OPTIONS="$MESON_OPTIONS -Dxe_driver=disabled"
  41. fi
  42. mkdir -p /igt
  43. meson build $MESON_OPTIONS $EXTRA_MESON_ARGS
  44. ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
  45. ninja -C build install
  46. if [[ "$KERNEL_ARCH" = "arm64" ]]; then
  47. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib/aarch64-linux-gnu
  48. elif [[ "$KERNEL_ARCH" = "arm" ]]; then
  49. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib
  50. else
  51. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib64
  52. fi
  53. echo "Generating ci-testlist.txt"
  54. generate_testlist
  55. mkdir -p artifacts/
  56. tar -cf artifacts/igt.tar /igt
  57. # Pass needed files to the test stage
  58. S3_ARTIFACT_NAME="igt.tar.gz"
  59. gzip -c artifacts/igt.tar > ${S3_ARTIFACT_NAME}
  60. ci-fairy s3cp --token-file "${S3_JWT_FILE}" ${S3_ARTIFACT_NAME} https://${PIPELINE_ARTIFACTS_BASE}/${KERNEL_ARCH}/${S3_ARTIFACT_NAME}