Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
install xvfb before running in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
priyamsahoo committed Feb 14, 2024
1 parent ddb72b5 commit c2691bd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [[ -f "/usr/bin/apt-get" ]]; then
INSTALL=0
# qemu-user-static is required by podman on arm64
# python3-dev is needed for headers as some packages might need to compile
DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static)
DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static xvfb x11-xserver-utils)
for DEB in "${DEBS[@]}"; do
[[ "$(dpkg-query --show --showformat='${db:Status-Status}\n' \
"${DEB}" || true)" != 'installed' ]] && INSTALL=1
Expand Down
25 changes: 25 additions & 0 deletions tools/vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ asdf local nodejs latest:18

unset VIRTUAL_ENV

if [[ -f "/usr/bin/apt-get" ]]; then
INSTALL=0
# qemu-user-static is required by podman on arm64
# python3-dev is needed for headers as some packages might need to compile
DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static xvfb x11-xserver-utils)
for DEB in "${DEBS[@]}"; do
[[ "$(dpkg-query --show --showformat='${db:Status-Status}\n' \
"${DEB}" || true)" != 'installed' ]] && INSTALL=1
done
if [[ "${INSTALL}" -eq 1 ]]; then
log warning "We need sudo to install some packages: ${DEBS[*]}"
# mandatory or other apt-get commands fail
sudo apt-get update -qq -o=Dpkg::Use-Pty=0
# avoid outdated ansible and pipx
sudo apt-get remove -y ansible pipx || true
# install all required packages
sudo apt-get -qq install -y \
--no-install-recommends \
--no-install-suggests \
-o=Dpkg::Use-Pty=0 "${DEBS[@]}"
fi
fi
log notice "Using $(python3 --version)"
log notice "xvfb installation done"

cleanup() {
rv=$?
pgrep xvfb-run | xargs --no-run-if-empty sudo kill || true
Expand Down

0 comments on commit c2691bd

Please sign in to comment.