We currently cross compile various BSD binaries but do not test them. This leads to regressions on master which are noticed in nightly builds and fixed here, recent examples include #36078 and #36145.
Build and test the binaries in this repo as part of our CI instead to avoid this regression/fix flip-flopping.
As we don't have native *BSD runners we require BSD VMs to test the binaries. https://github.com/vmactions offers these (and are currently being used in various nightly jobs).
Unfortunately it's not possible to run all of the cross-compiled binaries directly in these VMs because the VM image builds (via anyvm) are syspatching their images, which cause some function calls to be missing when executing the (pure) cross-compiled binaries.
Therefore here, and to keep all BSD builds following a single CI process, build and test all BSDs inside their VM.
The VM caches itself after its prepare step (installing dependencies) so operates similarly to an unchanged docker buildkit image stage.
A clean (no caches) build and test inside the VM on a free GHA runner takes ~ 60 minutes. With the various caches seeded this drops to about 20-30 minutes. On a larger Warp runner I'd expect both of these runtimes to be much shorter, but this is untested currently.
There is some slowness when the tests are completed: rsync copies various cache directories back out from the VM in case they want to be GHA-cached later. It may be possible to optimise this slowness a little in the future.
The patchset also includes two small fixes, one needed to get the tests running, and one to prevent an overly-long REST request hang observed during testing (it may be possible/preferable to drop the REST request timeout reduction before merging).
It also omits feature_reindex_init and p2p_private_broadcast_retry_v1 from the functional tests; the former fails, and the latter seems to take an extraordinarily long time. Both might be good candidates for investigation and followup PRs.
These jobs will require enabling 3 more actions:
vmactions/freebsd-vm@v1 vmactions/netbsd-vm@v1 vmactions/openbsd-vm@v1
I have tried to re-use or at least mimic the current CI execution model/flow wherever possible.