Skip to content

Commit 91c44c0

Browse files
committed
test(ci): add architecture matrix support
- Add explicit matrix include with os, arch, and runner - Support x86_64, aarch64, and arm64 architectures - Use matrix.runner for platform-specific runner selection - Update job name to display os and architecture
1 parent c068fce commit 91c44c0

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,39 @@ on:
1414

1515
jobs:
1616
test:
17-
name: Unit Test
17+
name: Unit Test (${{ matrix.os }} - ${{ matrix.arch }})
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-
os: [ubuntu-latest, macos-latest, windows-latest]
25+
include:
26+
# Linux x86_64
27+
- os: ubuntu-latest
28+
arch: x86_64
29+
runner: ubuntu-latest
30+
# Linux aarch64
31+
- os: ubuntu-latest
32+
arch: aarch64
33+
runner: ubuntu-24.04-arm
34+
# macOS x86_64
35+
- os: macos-latest
36+
arch: x86_64
37+
runner: macos-13
38+
# macOS arm64
39+
- os: macos-latest
40+
arch: arm64
41+
runner: macos-14
42+
# Windows x86_64
43+
- os: windows-latest
44+
arch: x86_64
45+
runner: windows-latest
2646
# 定时任务只测试 master 版本,其他情况测试所有版本
2747
version: ${{ github.event_name == 'schedule' && fromJSON('["master"]') || fromJSON('["0.14.1", "0.15.1", "master"]') }}
2848
fail-fast: false
29-
runs-on: ${{ matrix.os }}
49+
runs-on: ${{ matrix.runner }}
3050
steps:
3151
- name: Checkout code
3252
uses: actions/checkout@v4

0 commit comments

Comments
 (0)