Comment by 0x457
2 days ago
I'm probably wrong, but I think this kind of cross-compilation requires a nested virtualization and GHA hosted runners don't support it.
2 days ago
I'm probably wrong, but I think this kind of cross-compilation requires a nested virtualization and GHA hosted runners don't support it.
Why would it need virtualization at all? The point of cross-compiling is that you build binaries for a different arch/platform, ex. running gcc as an x86_64 binary on an x86_64 host turning C into aarch64 binaries.
GHA can do nested virt via KVM. Here is an action that runs a test that boots up a VM running NixOS: https://github.com/aksiksi/compose2nix/blob/main/.github/wor...
You can also run QEMU if you want to build for ARM (although this announcement makes this unnecessary): https://github.com/aksiksi/ncdmv/blob/aa108a1c1e2c14a13dfbc0...
They've done for a while.
My OSS Go project runs tests in 18 different OS/architecture combinations.
Some native, some using QEMU binfmt (user mode emulation on Linux), others launching a VM. In particular, that's how I test the BSDs and Solaris.
https://github.com/ncruces/go-sqlite3/wiki/Support-matrix
You can do cross compilation in GitHub actions and testing on QEMU is straightforward. I have a repo that builds for and tests half a dozen emulated targets.