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