Running tests in GitHub Actions

I have created bindings for GLFW in F#. This is working quite nice, and I have started writing tests to verify that my bindings and my wrappers of these bindings (that make the bindings more idiomatic to F#) work as expected. This is working nicely locally.

I would ideally like to start running these tests in GitHub Actions, however, there are issues with tests that require a window. Granted, the Actions’ runners are headless environments, but I was wondering: has anyone had success in running GLFW tests in GitHub Actions? Are there specific GLFW settings or window hints that I can set to make this happen?

My tests that do not create windows work fine in GitHub Actions, but those that do create windows seem to crash the runners. I tried creating the windows as not visible, hoping that would get around the environments being headless, but that didn’t seem to work either.

I unfortunately don’t get any information from the action report. The only thing it says is:

The active test run was aborted. Reason: Test host process crashed

Thanks for any help or advice!

Typically these runners are run in virtual machine or docker environment. And it requires special setup to allow to use GPU for applications running there. GitHub probably have not configured it, or the VM’s they use do not have any physical GPU in system at all (GPU instances are expensive in cloud).

That said, if you’re ok with slower execution, you could run your programs in software rasterizer. Mesa has a good llvmpipe based implementation that nowadays give 4.5 core or compatibility profile. You can build either regular opengl shared library file that glfw will be able to use (to make sure you get llvmpipe backend set GALLIUM_DRIVER environment variable to llvmpipe. Or you can build build special osmesa library that requires creating context differently, without depending on any windowing API. glfw supports this in window hint: GLFW_OSMESA_CONTEXT_API