diff --git a/ci/run-tests.sh b/ci/run-tests.sh index 49e80e0..c85b61a 100755 --- a/ci/run-tests.sh +++ b/ci/run-tests.sh @@ -24,6 +24,18 @@ if [[ ! -c $RENDER_DEVICE ]]; then LIMIT_TESTSET=--only-softpipe fi +if [[ $LOCAL_MESA ]]; then + cd $LOCAL_MESA && \ + mkdir -p build && \ + meson build/ && \ + meson configure build/ -Dprefix=/usr/local -Dplatforms=drm,x11,wayland,surfaceless -Ddri-drivers=i965 -Dgallium-drivers=swrast,virgl,radeonsi,r600 -Dbuildtype=debugoptimized -Dllvm=true -Dglx=dri -Dgallium-vdpau=false -Dgallium-va=false -Dvulkan-drivers=[] -Dlibdir=lib && \ + ninja -C build/ install + if [ $? -ne 0 ]; then + exit 1 + fi +fi + + cd /virglrenderer if [[ ! $LOCAL_DEV ]]; then ./autogen.sh --prefix=/usr/local --enable-debug --enable-tests @@ -35,14 +47,6 @@ if [[ ! $LOCAL_DEV ]]; then fi make -j$(nproc) install -if [[ $LOCAL_DEV ]]; then - cd /mesa - mkdir -p build - meson build/ - meson configure build/ -Dprefix=/usr/local -Dplatforms=drm,x11,wayland,surfaceless -Ddri-drivers=i965 -Dgallium-drivers=swrast,virgl,radeonsi,r600 -Dbuildtype=debugoptimized -Dllvm=true -Dglx=dri -Dgallium-vdpau=false -Dgallium-va=false -Dvulkan-drivers=[] -Dlibdir=lib - ninja -C build/ install -fi - : ' cd /qemu make -j$(nproc) install diff --git a/ci/run_ci_locally.sh b/ci/run_ci_locally.sh new file mode 100755 index 0000000..96b51a8 --- /dev/null +++ b/ci/run_ci_locally.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +PROJECT_PATH="$(dirname $(readlink -f "$0"))/.." + +cd ${PROJECT_PATH} + +DOCKER_DRIVER=overlay2 +RENDER_DEVICE=/dev/dri/renderD128 +DOCKER_IMAGE=virglrenderer/ci + +LOCAL_MESA_PATH="../$PROJECT_PATH/mesa" +LOCAL_VIRGL_PATH="${PROJECT_PATH}" + +if test -e $LOCAL_MESA_PATH; then LOCAL_MESA="-v $LOCAL_MESA_PATH:/local_mesa -e LOCAL_MESA=/local_mesa"; fi +if test -e $LOCAL_VIRGL_PATH; then LOCAL_VIRGL="-v $LOCAL_VIRGL_PATH:/virglrenderer -e LOCAL_VIRGL=/virglrenderer"; fi + +if test -e $RENDER_DEVICE; then RD_CONFIG="--device=$RENDER_DEVICE -e RENDER_DEVICE=$RENDER_DEVICE"; fi +echo LOCAL_MESA=$LOCAL_MESA +echo LOCAL_VIRGL=$LOCAL_VIRGL +echo RD_CONFIG=$RD_CONFIG + +rm -rf $PROJECT_PATH/results +mkdir -p $PROJECT_PATH/results + +time docker build -t $DOCKER_IMAGE -f ci/Dockerfile --cache-from $DOCKER_IMAGE:latest ci + +time docker run \ + -it \ + --ulimit core=99999999999:99999999999 \ + $RD_CONFIG \ + $LOCAL_MESA \ + $LOCAL_VIRGL \ + $DOCKER_IMAGE:latest \ + /virglrenderer/ci/run-tests.sh 2>&1 | tee results/log.txt \ No newline at end of file