mirror of
https://gitea.com/gitea/act_runner
synced 2026-09-21 19:37:07 +02:00
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:
@@ -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-")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user