DEV Community

David Cantrell
David Cantrell

Posted on

Automatic cross-platform testing: part 6: 32 bit Linux

Previously on this channel

Testing on 32 bit Linux

Just about every virtual machine out there in the various CI platforms and hosting companies is a 64 bit x86 machine. But I wanted to test my code on a 32 bit machine as well. Unfortunately without having real 32 bit hardware available, or emulating it on more modern hardware, you can't quite do this, but you can at least run an OS and use libraries compiled for 32 bit hardware, 32 bit memory management, and with 32 bit pointers.

It's surprisingly easy, and lot less hackish than the solution I found for testing on OpenBSD.

Github workflows normally run directly on whatever host type you specify in the runs-on option. But you can instead tell them to run in a container, which can be anything available on Docker Hub. Jobs running in a container can have all the same steps that you would have in a non-containerized job, including using other Github workflow actions.

To test my code on 32-bit Linux I use the i386/ubuntu:latest image. I am also using the same technique to run tests for one of my projects, which is sensitive to exactly which Linux distribution you are using, on Arch Linux, using the archlinux:latest image.

Top comments (1)

drhyde profile image
David Cantrell

Update: Github's actions for doing things like checking out your repository have recently been updated to use a more recent version of node, which is only (officially) available in 64 bit builds. So this no longer works. I now run Jenkins on a 32-bit OS in a VM at home and have that triggered by pushes to Github.