-
Notifications
You must be signed in to change notification settings - Fork 0
244 lines (227 loc) · 8.08 KB
/
Copy pathci.yml
File metadata and controls
244 lines (227 loc) · 8.08 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: Neko Log CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
build-and-test:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
# Windows builds
- {
name: "Windows MSVC Module Debug",
os: windows-2022,
cc: "cl",
cxx: "cl",
build_type: "Debug",
generators: "Visual Studio 17 2022",
enable_module: "ON"
}
- {
name: "Windows MSVC Module Release",
os: windows-2022,
cc: "cl",
cxx: "cl",
build_type: "Release",
generators: "Visual Studio 17 2022",
enable_module: "ON"
}
# Linux builds
- {
name: "Ubuntu GCC Debug",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
build_type: "Debug",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "Ubuntu GCC Release",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
build_type: "Release",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "Ubuntu Clang Debug",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
build_type: "Debug",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "Ubuntu Clang Release",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
build_type: "Release",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "Ubuntu Clang-18 Module Debug",
os: ubuntu-latest,
cc: "clang-18",
cxx: "clang++-18",
build_type: "Debug",
generators: "Ninja",
enable_module: "ON"
}
- {
name: "Ubuntu Clang-21 Module Release",
os: ubuntu-latest,
cc: "clang-21",
cxx: "clang++-21",
build_type: "Release",
generators: "Ninja",
enable_module: "ON"
}
# macOS builds
- {
name: "macOS Clang Debug",
os: macos-latest,
cc: "clang",
cxx: "clang++",
build_type: "Debug",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "macOS Clang Release",
os: macos-latest,
cc: "clang",
cxx: "clang++",
build_type: "Release",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "macOS GCC Debug",
os: macos-latest,
cc: "gcc",
cxx: "g++",
build_type: "Debug",
generators: "Unix Makefiles",
enable_module: "OFF"
}
- {
name: "macOS GCC Release",
os: macos-latest,
cc: "gcc",
cxx: "g++",
build_type: "Release",
generators: "Unix Makefiles",
enable_module: "OFF"
}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build
# For Clang builds, use the system default clang
# Ubuntu 24.04 (noble) comes with clang-18 by default
if [[ "${{ matrix.config.cxx }}" == "clang++" ]]; then
# System default clang is already installed
echo "Using system default clang"
clang++ --version
# For GCC builds
elif [[ "${{ matrix.config.cxx }}" == "g++" ]]; then
# System default g++ is already installed via build-essential
echo "Using system default g++"
g++ --version
fi
- name: Install Clang 18 (Ubuntu)
if: startsWith(matrix.config.os, 'ubuntu') && matrix.config.cc == 'clang-18'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
sudo apt-get update
sudo apt-get install -y clang-18 clang++-18
- name: Install Clang 21 (Ubuntu)
if: startsWith(matrix.config.os, 'ubuntu') && matrix.config.cc == 'clang-21'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main"
sudo apt-get update
sudo apt-get install -y clang-21 clang++-21
- name: Install dependencies (macOS)
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake ninja
- name: Install dependencies (Windows)
if: startsWith(matrix.config.os, 'windows')
run: |
if ("${{ matrix.config.generators }}" -eq "Ninja") {
choco install ninja
# Setup Clang
choco install llvm
}
- name: Check compiler versions (Unix)
if: "!startsWith(matrix.config.os, 'windows')"
run: |
echo "=== Compiler Information ==="
${{ matrix.config.cxx }} --version
echo "=== CMake Information ==="
cmake --version
echo "=== Ninja Information ==="
ninja --version
- name: Set up MSVC environment (Windows)
if: startsWith(matrix.config.os, 'windows') && matrix.config.cc == 'cl'
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Configure CMake
run: |
echo "=== Configuring NekoFunction (Ubuntu) ==="
echo "Compiler: ${{ matrix.config.cxx }}"
echo "Module support: ${{ matrix.config.enable_module }}"
if [[ "${{ matrix.config.generators }}" == *"Visual Studio"* ]]; then
# For Visual Studio generators, let CMake auto-detect the compiler
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -G "${{ matrix.config.generators }}" -DNEKO_LOG_BUILD_TESTS=ON -DNEKO_LOG_AUTO_FETCH_DEPS=ON -DNEKO_LOG_ENABLE_MODULE=${{ matrix.config.enable_module }}
else
# For other generators, specify the compiler explicitly
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -G "${{ matrix.config.generators }}" -DNEKO_LOG_BUILD_TESTS=ON -DNEKO_LOG_AUTO_FETCH_DEPS=ON -DNEKO_LOG_ENABLE_MODULE=${{ matrix.config.enable_module }}
fi
shell: bash
- name: Build
run: cmake --build build --config ${{ matrix.config.build_type }} --parallel
- name: Run tests
working-directory: build
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
if [ "${{ matrix.config.generators }}" = "Visual Studio 17 2022" ] || [ "${{ matrix.config.generators }}" = "Visual Studio 16 2019" ]; then
ctest -C ${{ matrix.config.build_type }} --output-on-failure --verbose
else
ctest --output-on-failure --verbose
fi
else
ctest --output-on-failure --verbose
fi
shell: bash
- name: Upload build artifacts (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.config.name }}
path: |
build/CMakeFiles/CMakeOutput.log
build/CMakeFiles/CMakeError.log
build/Testing/Temporary/LastTest.log