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 f0b15ce
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
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
27 changes: 26 additions & 1 deletion 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 All @@ -24,7 +49,7 @@ cleanup() {

if [[ -f "/usr/bin/apt-get" ]]; then
trap "cleanup" SIGINT SIGTERM ERR EXIT
xvfb-run --auto-servernum task devel -- ../ansible-language-server
sudo xvfb-run -e /dev/stdout --auto-servernum task devel -- ../ansible-language-server
else
task devel -- ../ansible-language-server
fi

0 comments on commit f0b15ce

Please sign in to comment.