ci: Always create results dir from init

During init-stage2 (used for hardware jobs) and setup-test-env (used
for running directly on shared runners), make sure we always create a
results directory.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31110>
This commit is contained in:
Daniel Stone
2024-08-21 11:56:33 +01:00
parent 111c15ae4a
commit 9b6d14aed1
2 changed files with 9 additions and 1 deletions

View File

@@ -206,7 +206,7 @@ EXIT_CODE=$?
set -e
# Let's make sure the results are always stored in current working directory
mv -f ${CI_PROJECT_DIR}/results ./ 2>/dev/null || true
mv -f ${RESULTS_DIR} ./ 2>/dev/null || true
[ ${EXIT_CODE} -ne 0 ] || rm -rf results/trace/"$PIGLIT_REPLAY_DEVICE_NAME"

View File

@@ -108,5 +108,13 @@ export -f uncollapsed_section_switch
# Freedesktop requirement (needed for Wayland)
[ -n "${XDG_RUNTIME_DIR}" ] || export XDG_RUNTIME_DIR="$(mktemp -p "$PWD" -d xdg-runtime-XXXXXX)"
if [ -z "${RESULTS_DIR:-}" ]; then
export RESULTS_DIR="$(pwd)/results"
if [ -e "${RESULTS_DIR}" ]; then
rm -rf "${RESULTS_DIR}"
fi
mkdir -p "${RESULTS_DIR}"
fi
set -E
trap 'trap_err $?' ERR