gitlab-ci: Place files from the Mesa repo into the build tarball
[mesa.git] / .gitlab-ci / prepare-artifacts.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 CROSS_FILE=/cross_file-"$CROSS".txt
7
8 # Delete unused bin and includes from artifacts to save space.
9 rm -rf install/bin install/include
10
11 # Strip the drivers in the artifacts to cut 80% of the artifacts size.
12 if [ -n "$CROSS" ]; then
13 STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" "$CROSS_FILE"`
14 if [ -z "$STRIP" ]; then
15 echo "Failed to find strip command in cross file"
16 exit 1
17 fi
18 else
19 STRIP="strip"
20 fi
21 find install -name \*.so -exec $STRIP {} \;
22
23 # Test runs don't pull down the git tree, so put the dEQP helper
24 # script and associated bits there.
25 cp VERSION install/
26 cp -Rp .gitlab-ci/deqp* install/
27 cp -Rp .gitlab-ci/piglit install/
28 cp -Rp .gitlab-ci/traces.yml install/
29 cp -Rp .gitlab-ci/tracie install/
30 cp -Rp .gitlab-ci/tracie-runner-gl.sh install/
31 cp -Rp .gitlab-ci/tracie-runner-vk.sh install/
32 cp -Rp .gitlab-ci/fossils.yml install/
33 cp -Rp .gitlab-ci/fossils install/
34 cp -Rp .gitlab-ci/fossilize-runner.sh install/
35 cp -Rp .gitlab-ci/deqp-runner.sh install/
36 cp -Rp .gitlab-ci/deqp-*-fails.txt install/
37 cp -Rp .gitlab-ci/deqp-*-skips.txt install/
38
39 # Tar up the install dir so that symlinks and hardlinks aren't each
40 # packed separately in the zip file.
41 mkdir -p artifacts/
42 tar -cf artifacts/install.tar install
43
44 # If the container has LAVA stuff, prepare the artifacts for LAVA jobs
45 if [ -d /lava-files ]; then
46 # Copy kernel and device trees for LAVA
47 cp /lava-files/*Image artifacts/.
48 cp /lava-files/*.dtb artifacts/.
49
50 # Pack ramdisk for LAVA
51 mkdir -p /lava-files/rootfs-${CROSS:-arm64}/install
52 cp -a install/* /lava-files/rootfs-${CROSS:-arm64}/install/.
53
54 pushd /lava-files/rootfs-${CROSS:-arm64}/
55 find -H | cpio -H newc -o | gzip -c - > $CI_PROJECT_DIR/artifacts/lava-rootfs-${CROSS:-arm64}.cpio.gz
56 popd
57
58 # Store job ID so the test stage can build URLs to the artifacts
59 echo $CI_JOB_ID > artifacts/build_job_id.txt
60
61 # Pass needed files to the test stage
62 cp $CI_PROJECT_DIR/.gitlab-ci/generate_lava.py artifacts/.
63 cp $CI_PROJECT_DIR/.gitlab-ci/lava-deqp.yml.jinja2 artifacts/.
64 fi