ci: Add support for running CI locally

Apart from just doing a local run, this script enables
a local mesa repository to be used for the CI run.

For this to work the mesa repository is assumed to
be located in a directory next to the virgilrenderer.

$ ls -la
.
..
mesa
virgilrenderer
$ virgilrenderer/ci/run_ci_locally.sh

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Robert Foss 6 years ago committed by Jakob Bornecrantz
parent 2f9edd6b9e
commit 9f8c75500e
  1. 20
      ci/run-tests.sh
  2. 34
      ci/run_ci_locally.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

@ -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
Loading…
Cancel
Save