Testing with GLMakie

I have a package that produces a plot for a type. The package also has a GLMakie extension, but when I run the CI tests I get this:

┌ Warning:     OpenGL/GLFW wasn't loaded correctly or couldn't be initialized.
│     This likely means, you're on a headless server without having OpenGL support setup correctly.
│     Have a look at the troubleshooting section in the readme:
│     https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie /usr/share/julia/packages/GLMakie/jOD8L/src/gl_backend.jl:4
ERROR: LoadError: InitError: Exception[GLFW.GLFWError(65550, "X11: The DISPLAY environment variable is missing"), ErrorException("glfwInit failed")]

I cannot precompile GLMakie and hence the extension.

How do I do that correctly?

You need to nistall xvfb and use it to start the julia process: