Automatic cross-platform testing: part 7: 32 bit, again

Published: (February 27, 2026 at 04:23 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

Background

I have written about this before, but I needed to revisit the topic. GitHub Actions for tasks such as checking out a repository and retrieving build artifacts are now 64‑bit only. While older versions of the actions could be used as a workaround, I opted for a different approach.

My new method builds on previous work that consolidates testing for various Unix‑like platforms into a single workflow. The workflow (see the GitHub file) tests on 64‑bit versions of NetBSD, FreeBSD, OpenBSD, IllumOS (the modern OpenSolaris), and Linux, and now also runs on 32‑bit Linux. The hardware remains 64‑bit with modern x86 ISA extensions, but the OS image uses 32‑bit addressing, userland, and toolchain. For a truly pure 32‑bit x86 environment you would need legacy hardware, such as a board based on the Vortex86 chipset (example).

Downloading the Latest Artifact

The workflow includes a compact implementation of actions/download-artifact. The original YAML line is expanded here for clarity:

curl -L -H "X-GitHub-Api-Version: 2022-11-28" \
     -H "Authorization: Bearer ${GH_TOKEN}" \
     -o dist-for-install.zip \
  $(curl -L -s \
         -H "Accept: application/vnd.github+json" \
         -H "Authorization: Bearer ${GH_TOKEN}" \
         -H "X-GitHub-Api-Version: 2022-11-28" \
         https://api.github.com/repos/${GH_REPOSITORY}/actions/artifacts \
         -o - \
    | jq -r '
         [.artifacts[] | select(.expired == false)]
         | max_by(.created_at).archive_download_url
      ')
  • The inner curl calls the GitHub API to list all artifacts for the repository, filters the JSON with jq to find the most recent non‑expired artifact, and extracts its archive_download_url.
  • The outer curl downloads that artifact as dist-for-install.zip.

Building Perl with 32‑bit Integers

Perl can be compiled on 32‑bit platforms to use either 32‑ or 64‑bit integers. On 64‑bit machines Perl defaults to 64‑bit integers, and many 32‑bit OS packages still ship Perl with 64‑bit ints. To test code with 32‑bit integers I build my own Perl from source:

curl -o perl-5.42.0-src.tar.gz https://cpan.metacpan.org/authors/id/B/BO/BOOK/perl-5.42.0.tar.gz
tar xzf perl-5.42.0-src.tar.gz
cd perl-5.42.0
sh Configure -de -Dprefix=$HOME/perl-5.42.0-installed
make -j $(nproc)
make install
$HOME/perl-5.42.0-installed/bin/perl -MCPAN -e 'install qw(App::cpanminus)'
  • The Configure step omits the -Duse64bitint flag that distribution packagers often add, ensuring a 32‑bit integer build.
  • I skip make test because I have already verified the build with the Docker image I’m using, saving considerable time.

Testing the Software

After extracting the artifact (GitHub wraps it in a ZIP file), the test sequence is straightforward:

unzip dist-for-install.zip
mkdir dist-for-test
tar -C dist-for-test -xzf *.tar.gz
cd dist-for-test/*
$HOME/perl-5.42.0-installed/bin/cpanm --installdeps .
$HOME/perl-5.42.0-installed/bin/perl Makefile.PL
make test TEST_VERBOSE=1
  • cpanm --installdeps . installs any module dependencies using the custom Perl.
  • make test TEST_VERBOSE=1 runs the test suite with verbose output.

And that’s it—automatic testing of your code on a 32‑bit platform using GitHub Actions.

0 views
Back to Blog

Related posts

Read more »