mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-22 06:45:03 +01:00
feat: tart macOS vm's as job container (#33)
adds the tart:// protocol to platform mapping e.g. `-P macos-14=tart://ghcr.io/cirruslabs/macos-sonoma-base:latest` if you have a mac. `add-path` is probably broken
This commit is contained in:
@@ -655,6 +655,9 @@ func (rc *RunContext) startContainer() common.Executor {
|
||||
if rc.IsHostEnv(ctx) {
|
||||
return rc.startHostEnvironment()(ctx)
|
||||
}
|
||||
if rc.IsTartEnv(ctx) {
|
||||
return rc.startTartEnvironment()(ctx)
|
||||
}
|
||||
return rc.startJobContainer()(ctx)
|
||||
}
|
||||
}
|
||||
@@ -665,6 +668,12 @@ func (rc *RunContext) IsHostEnv(ctx context.Context) bool {
|
||||
return image == "" && strings.EqualFold(platform, "-self-hosted")
|
||||
}
|
||||
|
||||
func (rc *RunContext) IsTartEnv(ctx context.Context) bool {
|
||||
platform := rc.runsOnImage(ctx)
|
||||
image := rc.containerImage(ctx)
|
||||
return image == "" && strings.HasPrefix(platform, "tart://")
|
||||
}
|
||||
|
||||
func (rc *RunContext) stopContainer() common.Executor {
|
||||
return rc.stopJobContainer()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user