-
Notifications
You must be signed in to change notification settings - Fork 1k
368 lines (352 loc) · 12.3 KB
/
ci.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# Copyright (c) 2021-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: oneTBB CI
on:
push:
branches: [master]
pull_request:
branches: [master]
types:
- opened
- synchronize
- reopened
permissions: read-all
env:
BUILD_CONCURRENCY: 2
MACOS_BUILD_CONCURRENCY: 3
TEST_TIMEOUT: 180
jobs:
codespell:
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Run scan
run: |
sudo apt update && sudo apt install -y codespell
${GITHUB_WORKSPACE}/.github/scripts/codespell.sh `pwd`
examples_clang-format:
runs-on: [ubuntu-20.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Run scan
run: |
command -v clang-format-10
cp -r examples examples_formatted
find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format-10 -style=file -i {} \;
diff -r examples examples_formatted
documentation:
needs: [codespell]
env:
BUILD_TYPE: oss
runs-on: [ubuntu-22.04]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
pip3 install -U Jinja2
pip3 install git+https://github.com/executablebooks/sphinx-book-theme.git
pip3 install sphinx-tabs
echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
mkdir html
- name: Build documentation
run: |
export BUILD_TYPE=${BUILD_TYPE} && sphinx-build doc html
tar -czvf html.tar.gz html/
- name: Save docs
uses: actions/[email protected]
with:
name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }}
path: html.tar.gz
pages:
if: ${{ github.ref == 'refs/heads/master' }}
permissions:
contents: write
pages: write
id-token: write
runs-on: ubuntu-latest
needs: [documentation]
steps:
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Set env
run: echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
- name: Download documetation
uses: actions/download-artifact@v2
with:
name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }}
- name: Publish to github pages
run: |
tar -xvf html.tar.gz
cd gh-pages
rm -rf *
touch .nojekyll # https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/
cp -r ../html/* .
git config user.name github-actions
git config user.email [email protected]
git add .
git commit --reset-author --amend -m "Update from GitHub Actions"
git push --force origin gh-pages
copyright_check:
if: ${{ github.ref != 'refs/heads/master' }}
runs-on: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run check
run: |
sed -i \
-e "/Copyright (c) .* Intel Corporation/s/ \([0-9]\+\)[-0-9]*/ \\1-$(date +%Y)/" \
-e "/Copyright (c) .* Intel Corporation/s/$(date +%Y)-$(date +%Y)/$(date +%Y)/" \
$(git diff --diff-filter=d --name-only ${{ github.event.pull_request.base.sha }})
git checkout -- third-party-programs.txt
git diff > years.diff
if [[ -s years.diff ]]; then
echo "Wrong copyright years"
cat years.diff
exit 1
fi
python_module_test_ubuntu_latest:
runs-on: [ubuntu-latest]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build && cd build
cmake -DTBB4PY_BUILD=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc ..
make VERBOSE=1 -j${BUILD_CONCURRENCY} python_build
ctest -R python_test --output-on-failure --timeout ${TEST_TIMEOUT}
linux-testing:
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}${{ matrix.cmake_static }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
c_compiler: gcc
cxx_compiler: g++
std: 14
build_type: relwithdebinfo
preview: 'OFF'
- os: ubuntu-20.04
c_compiler: gcc
cxx_compiler: g++
std: 17
build_type: release
preview: 'ON'
- os: ubuntu-20.04
c_compiler: gcc-10
cxx_compiler: g++-10
std: 20
build_type: debug
preview: 'ON'
- os: ubuntu-22.04
c_compiler: gcc-11
cxx_compiler: g++-11
std: 20
build_type: release
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
set -x
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_static }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
make VERBOSE=1 -j${BUILD_CONCURRENCY}
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
macos-testing:
name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}${{ matrix.cmake_static }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
c_compiler: clang
cxx_compiler: clang++
std: 14
build_type: relwithdebinfo
preview: 'ON'
- os: macos-13
c_compiler: clang
cxx_compiler: clang++
std: 20
build_type: release
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
set -x
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_static }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
make VERBOSE=1 -j${MACOS_BUILD_CONCURRENCY}
ctest --timeout ${TEST_TIMEOUT} --output-on-failure
windows-testing:
name: ${{ matrix.job_name }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
generator: Visual Studio 16 2019
c_compiler: cl
cxx_compiler: cl
std: 14
build_type: relwithdebinfo
preview: 'ON'
job_name: windows_cl2019_cxx14_relwithdebinfo_preview=ON
- os: windows-2019
generator: Visual Studio 16 2019
c_compiler: cl
cxx_compiler: cl
std: 20
build_type: release
preview: 'ON'
job_name: windows_cl2019_cxx20_release_preview=ON-DBUILD_SHARED_LIBS=OFF
cmake_static: -DBUILD_SHARED_LIBS=OFF
- os: windows-2022
generator: Visual Studio 17 2022
c_compiler: cl
cxx_compiler: cl
std: 17
build_type: relwithdebinfo
preview: 'OFF'
job_name: windows_cl2022_cxx17_relwithdebinfo_preview=OFF
steps:
- uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build
cd build
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} ${{ matrix.cmake_static }} `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} ..
cmake --build . --config ${{ matrix.build_type }} -j -v
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure
linux-examples-testing:
name: examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
c_compiler: gcc
cxx_compiler: g++
std: 14
build_type: relwithdebinfo
preview: 'OFF'
- os: ubuntu-20.04
c_compiler: gcc
cxx_compiler: g++
std: 17
build_type: release
preview: 'ON'
- os: ubuntu-20.04
c_compiler: gcc-10
cxx_compiler: g++-10
std: 20
build_type: debug
preview: 'ON'
steps:
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
set -x
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
cmake --build . -v --target light_test_examples
macos-examples-testing:
name: examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
c_compiler: clang
cxx_compiler: clang++
std: 14
build_type: relwithdebinfo
preview: 'ON'
steps:
- uses: actions/checkout@v4
- name: Run testing
shell: bash
run: |
set -x
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
cmake --build . -v --target light_test_examples
windows-examples-testing:
name: ${{ matrix.job_name }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
generator: Visual Studio 16 2019
c_compiler: cl
cxx_compiler: cl
std: 14
build_type: relwithdebinfo
preview: 'ON'
job_name: examples_windows_cl2019_cxx14_relwithdebinfo_preview=ON
- os: windows-2022
generator: Visual Studio 17 2022
c_compiler: cl
cxx_compiler: cl
std: 17
build_type: relwithdebinfo
preview: 'OFF'
job_name: examples_windows_cl2022_cxx17_relwithdebinfo_preview=OFF
steps:
- uses: actions/checkout@v4
- name: Run testing
run: |
mkdir build
cd build
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
cmake --build . -v --target light_test_examples