@@ -259,3 +259,106 @@ jobs:
259259 path : build/scan-build
260260 retention-days : 7
261261 if-no-files-found : ignore
262+ runtime-macos :
263+ name : Runtime (macOS Apple Silicon, HVF)
264+ needs : build-macos
265+ if : >
266+ github.event_name == 'push' || github.event_name == 'pull_request'
267+ runs-on : [self-hosted, macOS, arm64, hvf]
268+ timeout-minutes : 60
269+
270+ concurrency :
271+ group : runtime-macos-${{ github.ref }}
272+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
273+
274+ env :
275+ LINUX_TOOLCHAIN : /opt/toolchain/aarch64-linux-gnu
276+ GNU_OBJCOPY : /opt/homebrew/opt/binutils/bin/objcopy
277+ HOMEBREW_NO_INSTALL_CLEANUP : 1
278+ HOMEBREW_NO_AUTO_UPDATE : 1
279+ BREW_PKGS : binutils qemu
280+
281+ steps :
282+ - name : Checkout
283+ uses : actions/checkout@v6
284+
285+ - name : Host info
286+ run : |
287+ sw_vers
288+ uname -a
289+ uname -m
290+ sysctl kern.hv_support || true
291+ test "$(uname -m)" = "arm64"
292+
293+ - name : Cache Homebrew downloads
294+ uses : actions/cache@v5
295+ with :
296+ path : ~/Library/Caches/Homebrew/downloads
297+ key : brew-runtime-${{ runner.os }}-${{ runner.arch }}-${{ env.BREW_PKGS }}
298+
299+ - name : Install missing Homebrew packages
300+ run : |
301+ missing=()
302+
303+ for pkg in $BREW_PKGS; do
304+ if ! brew list --formula "$pkg" >/dev/null 2>&1; then
305+ missing+=("$pkg")
306+ fi
307+ done
308+
309+ if [ "${#missing[@]}" -gt 0 ]; then
310+ brew install --quiet "${missing[@]}"
311+ else
312+ echo "All Homebrew packages are already installed: $BREW_PKGS"
313+ fi
314+
315+ - name : Tool versions
316+ run : |
317+ command -v make
318+ command -v "$GNU_OBJCOPY"
319+ make -V .MAKE.VERSION 2>/dev/null || true
320+ "$GNU_OBJCOPY" --version | head -1
321+ qemu-aarch64 --version | head -1 || true
322+ python3 --version
323+
324+ - name : Check Rosetta for Linux
325+ run : |
326+ ROSETTA=/Library/Apple/usr/libexec/oah/RosettaLinux/rosetta
327+
328+ if [ ! -x "$ROSETTA" ]; then
329+ echo "::error::Rosetta for Linux runtime was not found at $ROSETTA"
330+ echo
331+ echo "Install Rosetta on the self-hosted Mac runner first:"
332+ echo " sudo softwareupdate --install-rosetta --agree-to-license"
333+ echo
334+ echo "Current /Library/Apple/usr/libexec/oah contents:"
335+ ls -R /Library/Apple/usr/libexec/oah || true
336+ exit 1
337+ fi
338+
339+ ls -l "$ROSETTA"
340+
341+ - name : Build elfuse
342+ run : |
343+ make elfuse
344+
345+ - name : Verify HVF entitlement is embedded
346+ run : |
347+ codesign -d --entitlements - build/elfuse 2>&1 \
348+ | grep -q 'com\.apple\.security\.hypervisor'
349+
350+ - name : test-hello
351+ run : |
352+ make test-hello
353+
354+ - name : test-multi-vcpu
355+ run : |
356+ make test-multi-vcpu
357+
358+ - name : make check
359+ run : |
360+ make check
361+
362+ - name : Test matrix
363+ run : |
364+ bash tests/test-matrix.sh all
0 commit comments