-
Notifications
You must be signed in to change notification settings - Fork 0
268 lines (236 loc) · 9.21 KB
/
build.yml
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: Build
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
HOMEBREW_NO_INSTALL_CLEANUP: 1
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CMAKE_PREFIX_PATH: ${{ matrix.cmake_prefix_path }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux-Clang
os: ubuntu-24.04
build_type: Release
generator: Ninja
clang_version: latest
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="-march=native" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON'
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest"
cmake_targets: all
macos_target: ""
- name: Linux-GCC
os: ubuntu-24.04
build_type: Debug
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -march=native" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON'
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest"
cmake_targets: all
macos_target: ""
- name: Emscripten
os: ubuntu-24.04
build_type: Release
generator: Ninja
clang_version: ""
cmake_bin: "emcmake cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="-msimd128 -msse4.2 -fexceptions" -D NEO_ENABLE_BENCHMARKS=OFF -D NEO_ENABLE_TOOLS=OFF -D NEO_ENABLE_XSIMD=ON'
cmake_prefix_path: ""
cmake_targets: all
macos_target: ""
- name: macOS-ARM64
os: macos-14
build_type: Release
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: ""
cmake_prefix_path: ""
cmake_targets: all
macos_target: "11.0"
- name: macOS-X64
os: macos-13
build_type: Release
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: ""
cmake_prefix_path: ""
cmake_targets: all
macos_target: "10.15"
- name: Windows-Clang
os: windows-latest
build_type: Release
generator: Ninja
clang_version: latest
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="-march=native" -D NEO_ENABLE_INTEL_IPP=OFF -D NEO_ENABLE_INTEL_MKL=OFF -D NEO_ENABLE_BENCHMARKS=OFF'
cmake_prefix_path: C:\Program Files (x86)\Intel\oneAPI\ipp\latest;C:\Program Files (x86)\Intel\oneAPI\mkl\latest
cmake_targets: all
macos_target: ""
- name: Windows-MSVC
os: windows-latest
build_type: Release
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="/arch:AVX2 /EHsc" -D NEO_ENABLE_INTEL_IPP=OFF -D NEO_ENABLE_INTEL_MKL=OFF'
cmake_prefix_path: C:\Program Files (x86)\Intel\oneAPI\ipp\latest;C:\Program Files (x86)\Intel\oneAPI\mkl\latest
cmake_targets: all
macos_target: ""
- name: Coverage-Native
os: ubuntu-22.04
build_type: Debug
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=native" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON'
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest"
cmake_targets: neosonar-neo-tests
macos_target: ""
- name: Coverage-SSE41
os: ubuntu-22.04
build_type: Debug
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=x86-64-v2" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON'
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest"
cmake_targets: neosonar-neo-tests
macos_target: ""
- name: Coverage-SSE2
os: ubuntu-22.04
build_type: Debug
generator: Ninja
clang_version: ""
cmake_bin: "cmake"
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=x86-64" -D NEO_ENABLE_INTEL_IPP=ON -D NEO_ENABLE_INTEL_MKL=ON'
cmake_prefix_path: "/opt/intel/oneapi/ipp/latest:/opt/intel/oneapi/mkl/latest"
cmake_targets: neosonar-neo-tests
macos_target: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: >
sudo apt update &&
sudo apt install
libcurl4-openssl-dev
libasound2-dev
xorg-dev
libfreetype6-dev
libglu1-mesa-dev
xvfb
ninja-build
gcovr
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install ninja osxutils
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: bash
run: choco install ninja ccache
- name: Install clang
if: matrix.clang_version != ''
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.clang_version }}
- name: Install IPP/MKL (Linux)
if: contains(matrix.name, 'Linux') || contains(matrix.name, 'Coverage')
shell: bash
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-oneapi-mkl-devel intel-oneapi-ipp-devel
# - name: Cache IPP (Windows)
# if: runner.os == 'Windows'
# id: cache-ipp
# uses: actions/cache@v4
# with:
# key: ipp-v4
# path: C:\Program Files (x86)\Intel
# - name: Install IPP (Windows)
# if: (runner.os == 'Windows') && (steps.cache-ipp.outputs.cache-hit != 'true')
# shell: bash
# run: |
# curl --output oneapi.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5cb30fb9-21e9-47e8-82da-a91e00191670/w_BaseKit_p_2024.0.1.45_offline.exe
# ./oneapi.exe -s -x -f oneapi
# ./oneapi/bootstrapper.exe -s -c --action install --components=intel.oneapi.win.ipp.devel:intel.oneapi.win.mkl.devel --eula=accept -p=NEED_VS2022_INTEGRATION=1 --log-dir=.
# - name: Save IPP cache (even on CI fail)
# if: runner.os == 'Windows' && (steps.cache-ipp.outputs.cache-hit != 'true')
# uses: actions/cache/save@v4
# with:
# path: C:\Program Files (x86)\Intel
# key: ipp-v4
- name: Setup emsdk
if: matrix.name == 'Emscripten'
uses: mymindstorm/setup-emsdk@v14
with:
version: latest
- name: Set up Visual Studio shell
if: ${{ matrix.name }} == 'Windows-MSVC'
uses: egor-tensin/vs-shell@v2
- name: Install ccache
uses: hendrikmuhs/ccache-action@main
with:
key: "neo-build-${{ matrix.name }}"
- name: Print native arch flags (GCC)
if: contains(matrix.name, 'Coverage')
shell: bash
run: gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
- name: CMake configure
shell: bash
run: >
${{ matrix.cmake_bin }} -S .
-B build
-G "${{ matrix.generator }}"
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
-D CMAKE_COMPILE_WARNING_AS_ERROR=OFF
${{ matrix.cmake_flags }}
- name: CMake build
shell: bash
run: cmake --build build --config ${{ matrix.build_type }} --target ${{ matrix.cmake_targets }}
- name: Test
if: matrix.name != 'Emscripten'
shell: bash
run: ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure
- name: Test (Emscripten)
if: matrix.name == 'Emscripten'
run: node build/test/neosonar-neo-tests.js -v high
- name: Coverage report
if: contains(matrix.name, 'Coverage')
shell: bash
run: >
gcovr
--xml-pretty
-e ".*_test\.cpp"
--exclude-unreachable-branches
--exclude-throw-branches
-r src
-s build
-o build/coverage.xml
- name: Upload coverage report
uses: codecov/codecov-action@v4
if: contains(matrix.name, 'Coverage')
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
fail_ci_if_error: true