SFML community forums

Help => General => Topic started by: Filosof on November 14, 2021, 07:57:25 pm

Title: Failed to open X11 display on GitHub Actions pipeline
Post by: Filosof on November 14, 2021, 07:57:25 pm
Trying to configure yml file for GitHub actions.
It configures and builds just fine using Conan packages. But when try to run ctest with 1 test case that using from SFML only loadFromFile function it aborts with message:
"Failed to open X11 display; make sure the DISPLAY environment variable is set correctly".

Already tried:
sudo apt install libsfml-dev mesa-utils xorg-dev ... etc.
export DISPLAY=:0.0, export DISPLAY=:1.0, export DISPLAY=:99.0 ... etc.
export LIBGL_ALWAYS_INDIRECT=0
(all things from https://en.sfml-dev.org/forums/index.php?topic=28293.0)

Nothing worked out.
yml file configuration: https://github.com/PavelCherniavskyi/BattleCity2/blob/master/.github/workflows/BuildAndTest.yml

Please help.
Title: Re: Failed to open X11 display on GitHub Actions pipeline
Post by: eXpl0it3r on November 14, 2021, 11:14:24 pm
You need an xserver to run SFML application under Linux.
But since GitHub Actions is head-less, this doesn't really work.

But you should be able to potentially use xvfb, see also https://stackoverflow.com/questions/63125480/running-a-gui-application-on-a-ci-service-without-x11