mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
On a cache miss (247 changed patches/manifest.json, part of the key) the runner's partial fetch of the pinned Linux tree took 22 minutes and the tree verification, which fetches its blobs lazily, another 20. The cache was saved only at the end of a successful job, so a run that failed or was cancelled after that paid it again next time. Both jobs now restore the checkouts with actions/cache/restore and save them with actions/cache/save right after bootstrap, when it was a miss.
153 lines
5.6 KiB
YAML
153 lines
5.6 KiB
YAML
# Offline checks for every push and pull request to main, on Apple silicon:
|
|
# the host test suite (the driver built for macOS against the CS fixture's
|
|
# software GPU and the DCN 4.0.1 display fixture; no GPU), the release
|
|
# check (no debug instrumentation in release objects), the HSA runtime's
|
|
# unit tests, and unsigned Xcode builds of the dext and the host app. No
|
|
# signing: the signed build and installer stay on a developer Mac. Both jobs
|
|
# run on the macOS 26 image with its newest Xcode 26: the driver calls
|
|
# IOSysCtlByName, which DriverKit SDKs before 25.4 (Xcode 26.4) do not
|
|
# export; the step fails loudly on an image without one.
|
|
#
|
|
# Not run here: the Vulkan offline tests need RADV and llama.cpp built
|
|
# (make radv, make llama-vulkan; about an hour more), so test-radv-offline,
|
|
# test-radv-scanout and test-llama-offline report SKIP.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
tests:
|
|
name: Offline tests
|
|
runs-on: macos-26
|
|
timeout-minutes: 240
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Xcode 26 (a DriverKit SDK with IOSysCtlByName)
|
|
run: |
|
|
xcode=$(ls -d /Applications/Xcode_26*.app 2>/dev/null | sort -V | tail -1)
|
|
if [ -z "$xcode" ]; then
|
|
echo "::error::this runner image has no Xcode 26; the dext needs DriverKit 25.4 or later"
|
|
ls -d /Applications/Xcode*.app
|
|
exit 1
|
|
fi
|
|
sudo xcode-select -s "$xcode"
|
|
xcodebuild -version
|
|
xcrun --sdk driverkit --show-sdk-version
|
|
lib="$(xcrun --sdk driverkit --show-sdk-path)/System/DriverKit/System/Library/Frameworks/DriverKit.framework/DriverKit.tbd"
|
|
if ! grep -q _IOSysCtlByName "$lib"; then
|
|
echo "::error::$xcode's DriverKit SDK does not export IOSysCtlByName (DriverKit 25.4 or later does)"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Tools
|
|
run: brew install ripgrep cmake
|
|
|
|
- name: Upstream checkouts (cached)
|
|
id: upstream
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: |
|
|
.git/modules
|
|
third_party/linux
|
|
build/firmware
|
|
key: upstream-${{ hashFiles('.gitmodules', 'patches/manifest.json', 'patches/linux/**', 'firmware/firmware.lock') }}
|
|
|
|
- name: Bootstrap (pinned Linux, declared patches, locked firmware)
|
|
run: bash scripts/bootstrap.sh
|
|
|
|
# Saved as soon as the checkouts exist, not at the end of the job: on a
|
|
# cache miss the first fetch from github.com takes about 40 minutes on
|
|
# a runner, and a job that fails or is cancelled later would otherwise
|
|
# never save it.
|
|
- name: Save the upstream checkouts
|
|
if: steps.upstream.outputs.cache-hit != 'true'
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
path: |
|
|
.git/modules
|
|
third_party/linux
|
|
build/firmware
|
|
key: ${{ steps.upstream.outputs.cache-primary-key }}
|
|
|
|
- name: Offline test suite
|
|
run: make -k test
|
|
|
|
- name: Release check
|
|
run: make check-release
|
|
|
|
- name: HSA runtime tests
|
|
run: make hsa-test
|
|
|
|
xcode:
|
|
name: Unsigned Xcode build
|
|
runs-on: macos-26
|
|
timeout-minutes: 120
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Xcode 26 (a DriverKit SDK with IOSysCtlByName)
|
|
run: |
|
|
xcode=$(ls -d /Applications/Xcode_26*.app 2>/dev/null | sort -V | tail -1)
|
|
if [ -z "$xcode" ]; then
|
|
echo "::error::this runner image has no Xcode 26; the dext needs DriverKit 25.4 or later"
|
|
ls -d /Applications/Xcode*.app
|
|
exit 1
|
|
fi
|
|
sudo xcode-select -s "$xcode"
|
|
xcodebuild -version
|
|
xcrun --sdk driverkit --show-sdk-version
|
|
lib="$(xcrun --sdk driverkit --show-sdk-path)/System/DriverKit/System/Library/Frameworks/DriverKit.framework/DriverKit.tbd"
|
|
if ! grep -q _IOSysCtlByName "$lib"; then
|
|
echo "::error::$xcode's DriverKit SDK does not export IOSysCtlByName (DriverKit 25.4 or later does)"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Upstream checkouts (cached)
|
|
id: upstream
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: |
|
|
.git/modules
|
|
third_party/linux
|
|
build/firmware
|
|
key: upstream-${{ hashFiles('.gitmodules', 'patches/manifest.json', 'patches/linux/**', 'firmware/firmware.lock') }}
|
|
|
|
- name: Bootstrap
|
|
run: bash scripts/bootstrap.sh
|
|
|
|
# Saved as soon as the checkouts exist, not at the end of the job: on a
|
|
# cache miss the first fetch from github.com takes about 40 minutes on
|
|
# a runner, and a job that fails or is cancelled later would otherwise
|
|
# never save it.
|
|
- name: Save the upstream checkouts
|
|
if: steps.upstream.outputs.cache-hit != 'true'
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
path: |
|
|
.git/modules
|
|
third_party/linux
|
|
build/firmware
|
|
key: ${{ steps.upstream.outputs.cache-primary-key }}
|
|
|
|
- name: Driver library for DriverKit
|
|
run: make lib-dext
|
|
|
|
- name: Dext (unsigned)
|
|
run: >
|
|
xcodebuild -project mac_linuxgpu.xcodeproj -target MacLinuxGPU -configuration Release
|
|
CODE_SIGNING_ALLOWED=NO SYMROOT="$PWD/build/ci" OBJROOT="$PWD/build/ci/obj" build
|
|
|
|
- name: Host app (unsigned)
|
|
run: >
|
|
xcodebuild -project mac_linuxgpu.xcodeproj -target MacLinuxGPUHost -configuration Release
|
|
CODE_SIGNING_ALLOWED=NO SYMROOT="$PWD/build/ci" OBJROOT="$PWD/build/ci/obj" build
|