Skip to content

Commit 7839af0

Browse files
committed
ci: 添加 Windows、macOS、Linux 多平台 CI 工作流
- 支持 Ubuntu、macOS、Windows 三个平台 - 支持 Release 和 Debug 两种构建类型 - 自动运行测试
1 parent 9c30aa4 commit 7839af0

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
build_type: [Release, Debug]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Configure CMake
22+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
23+
24+
- name: Build
25+
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
26+
27+
- name: Test
28+
working-directory: ${{github.workspace}}/build
29+
run: ${{ runner.os == 'Windows' && './Test.exe' || './Test' }}

0 commit comments

Comments
 (0)