Support GitHub Actions aarch64 runners
GitHub now offers free aarch64 runners. Automatically select the default apk-tools-url and arch to match the CPU architecture of the current runner. Run armv7 and armhf without QEMU on aarch64 runners. For symmetry, allow emulating x86 and x86_64 on aarch64.
Document how to run aarch64 without emulation. Change existing aarch64 examples to ppc64le, to avoid encouraging emulation of aarch64.
Fixes #11.
In my tests, CPU emulation on the aarch64 runners is notably faster than on x86_64, so I've added a commit noting that in the README.
Oh? 32-bit arm is native now? That's real nice.
@jirutka: Thank you very much for providing this action. @bgilbert: And thank you for proposing these changes.
Is there any chance this will be considered for merging? I would very much appreciate to be able run this action on GitHub-hosted ARM runners that are now also available for open source projects for free (as in free beer).
While this PR is pending, you can run Alpine natively on aarch64 and armv7 with something like:
jobs:
alpine:
# Run any emulated CPUs (e.g. riscv64) on aarch64 runners, which appear to be faster
runs-on: ${{ startsWith(matrix.platform, 'x86') && 'ubuntu-latest' || 'ubuntu-24.04-arm' }}
strategy:
matrix:
# add 'x86_64', 'x86', 'ppc64le', 'riscv64', etc. as desired
platform: ['aarch64', 'armv7']
steps:
- name: Set up Alpine
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.platform }}
apk-tools-url: ${{ startsWith(matrix.platform, 'x86') && 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62' || 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878' }}
- name: Disable QEMU emulation
if: matrix.platform == 'armv7'
run: sudo update-binfmts --disable qemu-arm
# your steps here
@bgilbert: Thank you for the hints.
In some tests on a fork of the SuiteSparse repository, it looked like the Ubuntu on ARM runners were slower in emulating other CPUs than using ubuntu-latest. So, I opted for only using the Ubuntu on ARM runners for armv7.
I might have been unlucky and got some particularly slow runners when testing with Ubuntu on ARM. So, I don't know how representative that test was.
Okay, thanks for the info. To avoid making a counterproductive change, I've dropped the README recommendation to run emulated CPUs on ARM.
Is there anything I can do to help get this in?
Needs rebasing.
Rebased.
@jirutka Would really appreciate if you could take a look.