enhance: add macOS VM executor backend

Replace the Tart-based prototype with a runner-oriented macOS VM
executor backed by runner-executor-macos and Apple Virtualization.

Assisted-by: Codet:MODEL_VERSION
This commit is contained in:
Lunny Xiao
2026-09-05 13:20:03 -07:00
parent 1745c7c841
commit 2db24c7401
18 changed files with 1167 additions and 15 deletions
+23
View File
@@ -18,6 +18,7 @@ import (
"gitea.com/gitea/runner/act/common"
"gitea.com/gitea/runner/act/container"
"gitea.com/gitea/runner/internal/pkg/labels"
"gitea.dev/actionslib/pkg/exprparser"
"gitea.dev/actionslib/pkg/model"
@@ -1458,3 +1459,25 @@ func TestRunContextWithGithubEnvRunnerValues(t *testing.T) {
assert.Equal(t, "/workspace/owner", env["RUNNER_WORKSPACE"])
assert.Equal(t, "1", env["RUNNER_DEBUG"])
}
func TestRunContextMacOSVMPlatform(t *testing.T) {
rc := createRunsOnRunContext(t, "macos-latest")
rc.Config.PlatformPicker = func([]string) string {
return labels.MacOSVMSchemePrefix + "ghcr.io/cirruslabs/macos-sonoma-base:latest"
}
require.NoError(t, rc.resolvePlatformImage(t.Context()))
assert.True(t, rc.IsMacOSVMEnv())
assert.False(t, rc.IsHostEnv())
assert.Equal(t, "ghcr.io/cirruslabs/macos-sonoma-base:latest", rc.macOSVMImage())
}
func TestRunContextMacOSVMGuestWorkdir(t *testing.T) {
rc := createRunsOnRunContext(t, "macos-latest")
rc.Config.Workdir = "/workspace/owner/repo"
rc.Config.MacOSVM.WorkdirParent = "/Users/admin/runner"
rc.Config.RunnerUUID = "runner-1"
assert.Equal(t, "/Users/admin/runner/workspace/owner/repo", rc.macOSVMGuestWorkdir())
assert.Contains(t, rc.macOSVMName(), "GITEA-MACOS-VM-runner-1-")
}