act 中的 runner 和 GitHub Runners 同等(表格来自 Standard GitHub-hosted runners for Public repositories[4]):
Virtual MachineProcessor (CPU)Memory (RAM)Storage (SSD)Workflow labelNotesLinux416GB14GBubuntu-latest, ubuntu-24.04 [Beta], ubuntu-22.04, ubuntu-20.04The ubuntu-latest label currently uses the Ubuntu 22.04 runner image.Windows416GB14GBwindows-latest, windows-2022, windows-2019The windows-latest label currently uses the Windows 2022 runner image.macOS314GB14GBmacos-12 or macos-11The macos-11 label has been deprecated and will no longer be available after 28 June 2024.macOS414GB14GBmacos-13NAmacOS3(M1)7GB14GBmacos-latest or macos-14The macos-latest label currently uses the macOS 14 runner image. **Workflow label **指定差别平台的 Runner,act 中通过 -P label=image 来指定差别平台利用什么容器镜像运行。假如没有镜像,则可以通过 -P label=self-hosted表示 act 直接在宿主机运行 Actions[5]。
act -P ubuntu-latest=-self-hosted
act -P windows-latest=-self-hosted
act -P macos-latest=-self-hosted
复制代码
act runner 的局限
act runner 不是万能的。起首表示 runner 的平台标签 (ubuntu-latest 等)要和宿主机的指令架构同等。好比在 M 芯片的 苹果机器上,是不能运行
[code]# Apple M 芯片不能运行 amd 64 芯片镜像的
$ act -P ubuntu-latest=adolphlwq/act-runner-ubuntu:22.04
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock'
WARN ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
INFO[0000] Start server on http://192.168.6.234:34567
[release/generate-windows-rocm]