Repository navigation
214 lines (181 loc) · 5.6 KB
/
Copy pathci.yml
File metadata and controls
214 lines (181 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:
env:
# 固定 vcpkg 版本保证可重复性
VCPKG_COMMIT_ID: "2026.01.16"
jobs:
test-linux:
name: Linux - GCC (x64-linux)
runs-on: ubuntu-latest
env:
CXX: g++
CC: gcc
steps:
- uses: actions/checkout@v4
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg
cd /opt/vcpkg
git checkout ${{ env.VCPKG_COMMIT_ID }}
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
path: /opt/vcpkg/packages
key: ${{ runner.os }}-x64-linux-gcc-vcpkg-${{ env.VCPKG_COMMIT_ID }}
restore-keys: |
${{ runner.os }}-x64-linux-gcc-vcpkg-
- name: Configure CMake
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake -DPRISM_EN_TEST=ON
- name: Build
run: |
cd build
cmake --build .
- name: Run tests with CTest
run: |
cd build
ctest --output-on-failure
test-linux-clang:
name: Linux - Clang (x64-linux)
runs-on: ubuntu-latest
env:
CXX: clang++
CC: clang
steps:
- uses: actions/checkout@v4
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg
cd /opt/vcpkg
git checkout ${{ env.VCPKG_COMMIT_ID }}
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
path: /opt/vcpkg/packages
key: ${{ runner.os }}-x64-linux-clang-vcpkg-${{ env.VCPKG_COMMIT_ID }}
restore-keys: |
${{ runner.os }}-x64-linux-clang-vcpkg-
- name: Configure CMake
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake -DPRISM_EN_TEST=ON
- name: Build
run: |
cd build
cmake --build .
- name: Run tests with CTest
run: |
cd build
ctest --output-on-failure
test-windows:
name: Windows - MSVC (x64-windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install vcpkg
run: |
Remove-Item -Recurse -Force C:/vcpkg -ErrorAction SilentlyContinue
git clone https://github.com/microsoft/vcpkg.git C:/vcpkg
cd C:/vcpkg
git checkout ${{ env.VCPKG_COMMIT_ID }}
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
path: C:/vcpkg/packages
key: ${{ runner.os }}-x64-windows-vcpkg-${{ env.VCPKG_COMMIT_ID }}
restore-keys: |
${{ runner.os }}-x64-windows-vcpkg-
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DPRISM_EN_TEST=ON
- name: Build
run: |
cd build
cmake --build .
- name: Run tests with CTest
run: |
cd build
ctest --output-on-failure
test-windows-mingw:
name: Windows - MinGW (x64-mingw-static)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-make
- uses: actions/checkout@v4
- name: Install vcpkg
run: |
rm -rf vcpkg
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
git checkout ${{ env.VCPKG_COMMIT_ID }}
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
path: vcpkg/packages
key: ${{ runner.os }}-x64-mingw-static-vcpkg-${{ env.VCPKG_COMMIT_ID }}
restore-keys: |
${{ runner.os }}-x64-mingw-static-vcpkg-${{ env.VCPKG_COMMIT_ID }}
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DPRISM_EN_TEST=ON
- name: Build
run: |
cd build
cmake --build .
- name: Run tests with CTest
run: |
cd build
ctest --output-on-failure
test-macos:
name: macOS - ${{ matrix.triplet }}
runs-on: macos-latest
strategy:
matrix:
triplet: [x64-osx, arm64-osx]
steps:
- uses: actions/checkout@v4
- name: Install vcpkg
run: |
rm -rf ${{ runner.temp }}/vcpkg
git clone https://github.com/microsoft/vcpkg.git ${{ runner.temp }}/vcpkg
cd ${{ runner.temp }}/vcpkg
git checkout ${{ env.VCPKG_COMMIT_ID }}
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/vcpkg/packages
key: ${{ runner.os }}-${{ matrix.triplet }}-vcpkg-${{ env.VCPKG_COMMIT_ID }}
restore-keys: |
${{ runner.os }}-${{ matrix.triplet }}-vcpkg-
- name: Configure CMake
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DPRISM_EN_TEST=ON
- name: Build
run: |
cd build
cmake --build .
- name: Run tests with CTest
run: |
cd build
ctest --output-on-failure