Skip to content

Commit 2309336

Browse files
committed
test(ci): add Zig version matrix support
- Add version matrix with conditional scheduling - Add arch_config identifier for each architecture - Update job name to include Zig version - Reorganize matrix include blocks for clarity
1 parent 0ab6347 commit 2309336

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,44 @@ on:
1414

1515
jobs:
1616
test:
17-
name: Unit Test (${{ matrix.os }} - ${{ matrix.arch }})
17+
name: Unit Test (${{ matrix.os }} - ${{ matrix.arch }} - Zig ${{ matrix.version }})
1818
# 依赖 format check 成功,或定时任务/手动触发时执行
1919
if: |
2020
github.event_name == 'schedule' ||
2121
github.event_name == 'workflow_dispatch' ||
2222
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
2323
strategy:
2424
matrix:
25+
# 架构配置标识符
26+
arch_config: [linux-x86_64, linux-aarch64, macos-x86_64, macos-arm64, windows-x86_64]
27+
# 定时任务只测试 master 版本,其他情况测试所有版本
28+
version: ${{ github.event_name == 'schedule' && fromJSON('["master"]') || fromJSON('["0.14.1", "0.15.1", "master"]') }}
2529
include:
2630
# Linux x86_64
27-
- os: ubuntu-latest
31+
- arch_config: linux-x86_64
32+
os: ubuntu-latest
2833
arch: x86_64
2934
runner: ubuntu-latest
3035
# Linux aarch64
31-
- os: ubuntu-latest
36+
- arch_config: linux-aarch64
37+
os: ubuntu-latest
3238
arch: aarch64
3339
runner: ubuntu-24.04-arm
3440
# macOS x86_64
35-
- os: macos-latest
41+
- arch_config: macos-x86_64
42+
os: macos-latest
3643
arch: x86_64
3744
runner: macos-13
3845
# macOS arm64
39-
- os: macos-latest
46+
- arch_config: macos-arm64
47+
os: macos-latest
4048
arch: arm64
4149
runner: macos-14
4250
# Windows x86_64
43-
- os: windows-latest
51+
- arch_config: windows-x86_64
52+
os: windows-latest
4453
arch: x86_64
4554
runner: windows-latest
46-
# 定时任务只测试 master 版本,其他情况测试所有版本
47-
version: ${{ github.event_name == 'schedule' && fromJSON('["master"]') || fromJSON('["0.14.1", "0.15.1", "master"]') }}
4855
fail-fast: false
4956
runs-on: ${{ matrix.runner }}
5057
steps:

0 commit comments

Comments
 (0)