162306a36Sopenharmony_ci#!/bin/bash
262306a36Sopenharmony_ci# SPDX-License-Identifier: MIT
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciset -ex
562306a36Sopenharmony_ci
662306a36Sopenharmony_cigit clone https://gitlab.freedesktop.org/drm/igt-gpu-tools.git --single-branch --no-checkout
762306a36Sopenharmony_cicd igt-gpu-tools
862306a36Sopenharmony_cigit checkout $IGT_VERSION
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciif [[ "$KERNEL_ARCH" = "arm" ]]; then
1162306a36Sopenharmony_ci    . ../.gitlab-ci/container/create-cross-file.sh armhf
1262306a36Sopenharmony_ci    EXTRA_MESON_ARGS="--cross-file /cross_file-armhf.txt"
1362306a36Sopenharmony_cifi
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciMESON_OPTIONS="-Doverlay=disabled                    \
1662306a36Sopenharmony_ci               -Dchamelium=disabled                  \
1762306a36Sopenharmony_ci               -Dvalgrind=disabled                   \
1862306a36Sopenharmony_ci               -Dman=enabled                         \
1962306a36Sopenharmony_ci               -Dtests=enabled                       \
2062306a36Sopenharmony_ci               -Drunner=enabled                      \
2162306a36Sopenharmony_ci               -Dlibunwind=enabled                   \
2262306a36Sopenharmony_ci               -Dprefix=/igt"
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_cimkdir -p /igt
2562306a36Sopenharmony_cimeson build $MESON_OPTIONS $EXTRA_MESON_ARGS
2662306a36Sopenharmony_cininja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
2762306a36Sopenharmony_cininja -C build install
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_cimkdir -p artifacts/
3062306a36Sopenharmony_citar -cf artifacts/igt.tar /igt
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci# Pass needed files to the test stage
3362306a36Sopenharmony_ciS3_ARTIFACT_NAME="igt.tar.gz"
3462306a36Sopenharmony_cigzip -c artifacts/igt.tar > ${S3_ARTIFACT_NAME}
3562306a36Sopenharmony_cici-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ${S3_ARTIFACT_NAME} https://${PIPELINE_ARTIFACTS_BASE}/${KERNEL_ARCH}/${S3_ARTIFACT_NAME}
36