我正在尝试将 windows-latest 添加为此工作流程的目标:
name: Arena Tests
on: [workflow_dispatch, push, pull_request]
jobs:
test_cross_platform:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: make
- name: Run tests
run: make test
目前,在列表中添加
windows-latest
失败,因为 make
无法识别。
根据: runner-images,windows-latest 的软件包管理器是 Chocolatey Software,其中包含 MinGW-w64 13.2.0 和 GNU make 4.4.1 的软件包,可以通过以下方式安装:
choco install mingw
choco install make
我的问题是:将这些添加到 YML 文件后,我是否需要使用
PATH
环境变量或执行其他操作,然后才能简单地运行:
make
make test
在Windows机器上,类似于MacOS和Linux?
注意:代码是用标准 C99 编写的,不依赖于任何特定于 POSIX 的内容,并且应该在 Windows 上干净地编译。
我个人建议使用 MSYS2 进行工作流程,特别是在为多个平台构建时。
这是我创建的一个最小项目的工作流程,用于说明如何针对 Windows + MacOS + Linux 进行构建:
https://github.com/brechtsanders/ci-test/blob/master/.github/workflows/ci-test.yml