pass extra metadata (repo refs, timestamps) to test results
This commit is contained in:
@@ -20,7 +20,12 @@ build() {
|
||||
|
||||
rendertest() {
|
||||
pushd /build/HLRTest/render
|
||||
WAYLAND_DISPLAY=/tmp/wayland-headless ./rendertest.py --xash-dir /opt/hl run
|
||||
WAYLAND_DISPLAY=/tmp/wayland-headless ./rendertest.py \
|
||||
--xash-dir /opt/hl \
|
||||
--xash-revision "${XASH3D_REVISION}" \
|
||||
--pbr-revision "${PBR_REVISION}" \
|
||||
--tests-revision "${HLRTEST_REVISION}" \
|
||||
run
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
+38
-5
@@ -3,7 +3,7 @@ set -eux
|
||||
|
||||
NAME=xash-builder
|
||||
|
||||
HLRTEST_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
|
||||
HLRTEST_REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
|
||||
|
||||
source .env
|
||||
|
||||
@@ -20,10 +20,37 @@ build() {
|
||||
build-image
|
||||
}
|
||||
|
||||
git_short() {
|
||||
local dir="${1:-.}"
|
||||
local hash dirty_flag
|
||||
|
||||
# Get short commit hash
|
||||
hash=$(cd "$dir" && git rev-parse --short HEAD 2>/dev/null)
|
||||
|
||||
if [[ -z "$hash" ]]; then
|
||||
echo "Not a git repository" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check for uncommitted changes (staged or unstaged)
|
||||
dirty_flag=$(cd "$dir" && git status --porcelain --untracked-files=no 2>/dev/null)
|
||||
|
||||
if [[ -n "$dirty_flag" ]]; then
|
||||
echo "${hash}-dirty"
|
||||
else
|
||||
echo "$hash"
|
||||
fi
|
||||
}
|
||||
|
||||
render-test() {
|
||||
OUTPUT="${HLRTEST_PATH}/render/work"
|
||||
# Make sure the image ubuntu user can write to the output
|
||||
chmod -R o+rw "${OUTPUT}"
|
||||
local OUTPUT="${HLRTEST_REPO_DIR}/render/work"
|
||||
|
||||
local HLRTEST_REVISION=$(git_short "${HLRTEST_REPO_DIR}")
|
||||
local XASH3D_REVISION=$(git_short "${XASH3D_RT_REPO_DIR}")
|
||||
local PBR_REVISION=$(git_short "${HALFLIFE_PBR_REPO_DIR}")
|
||||
|
||||
# Make sure the image's ubuntu (uid=1000) user can write to the output
|
||||
#chmod -R o+rw "${OUTPUT}"
|
||||
|
||||
podman run -it --rm \
|
||||
--name ${NAME} \
|
||||
@@ -34,14 +61,20 @@ render-test() {
|
||||
--read-only \
|
||||
--tmpfs /tmp \
|
||||
\
|
||||
-e HLRTEST_REVISION="${HLRTEST_REVISION}" \
|
||||
-e XASH3D_REVISION="${XASH3D_REVISION}" \
|
||||
-e PBR_REVISION="${PBR_REVISION}" \
|
||||
\
|
||||
-v /dev/dri/renderD128:/dev/dri/renderD128:ro \
|
||||
\
|
||||
-v /opt/hl \
|
||||
-v /home/ubuntu \
|
||||
-v ${HALFLIFE_PBR_REPO_DIR}/valve/pbr:/opt/hl/valve/pbr:ro \
|
||||
-v ${HALFLIFE_PBR_REPO_DIR}/valve/bluenoise:/opt/hl/valve/bluenoise:ro \
|
||||
\
|
||||
-v ${XASH3D_RT_REPO_DIR}:/build/xash3d-fwgs:O \
|
||||
\
|
||||
-v ${HLRTEST_PATH}:/build/HLRTest:ro \
|
||||
-v ${HLRTEST_REPO_DIR}:/build/HLRTest:ro \
|
||||
-v ${OUTPUT}:/build/HLRTest/render/work \
|
||||
\
|
||||
ubuntu-xash-builder:latest \
|
||||
|
||||
Reference in New Issue
Block a user