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 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504
|
# Copyright (c) 2021-2025 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
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'refs/heads/master') }}
jobs:
codespell:
runs-on: [ubuntu-22.04]
timeout-minutes: 10
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-22.04]
timeout-minutes: 10
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run scan
run: |
command -v clang-format
cp -r examples examples_formatted
find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format -style=file -i {} \;
diff -r examples examples_formatted
documentation:
needs: [codespell]
env:
BUILD_TYPE: oss
runs-on: [ubuntu-latest]
timeout-minutes: 10
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install prerequisites
run: |
pip3 install -U Jinja2
pip3 install git+https://github.com/executablebooks/sphinx-book-theme.git
pip3 install sphinx_design
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/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
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: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout gh-pages
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
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 github-actions@github.com
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-latest]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-22.04
c_compiler: gcc
cxx_compiler: g++
std: 17
build_type: release
preview: 'ON'
- os: ubuntu-24.04-arm
c_compiler: gcc-14
cxx_compiler: g++-14
std: 20
build_type: debug
preview: 'ON'
- os: ubuntu-24.04-arm
c_compiler: clang
cxx_compiler: clang++
std: 20
build_type: release
preview: 'ON'
- os: ubuntu-22.04-arm
c_compiler: gcc
cxx_compiler: g++
std: 20
build_type: release
preview: 'ON'
cmake_static: -DBUILD_SHARED_LIBS=OFF
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-15
c_compiler: clang
cxx_compiler: clang++
std: 17
build_type: debug
preview: 'ON'
- os: macos-14
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:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-2025
generator: Visual Studio 17 2022
c_compiler: cl
cxx_compiler: cl
std: 14
build_type: relwithdebinfo
preview: 'ON'
job_name: windows_cl2022_cxx14_relwithdebinfo_preview=ON
- os: windows-11-arm
generator: Visual Studio 17 2022
c_compiler: cl
cxx_compiler: cl
std: 20
build_type: release
preview: 'ON'
job_name: windows_11_arm_cl2022_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:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-22.04
c_compiler: gcc
cxx_compiler: g++
std: 17
build_type: release
preview: 'ON'
- os: ubuntu-24.04
c_compiler: gcc
cxx_compiler: g++
std: 20
build_type: debug
preview: 'ON'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-15
c_compiler: clang
cxx_compiler: clang++
std: 14
build_type: relwithdebinfo
preview: 'ON'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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-11-arm
generator: Visual Studio 17 2022
c_compiler: cl
cxx_compiler: cl
std: 14
build_type: relwithdebinfo
preview: 'ON'
job_name: examples_windows_11_arm_cl2022_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:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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
linux-doc-examples-testing:
name: doc_examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
c_compiler: gcc
cxx_compiler: g++
std: 20
build_type: relwithdebinfo
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Test doc examples
run: |
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_TEST=OFF -DTBB_DOC_EXAMPLES=ON ..
cmake --build . -v --parallel --target build-doc-examples
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure -L doc-examples
windows-doc-examples-testing:
name: doc_examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
generator: "Visual Studio 17 2022"
c_compiler: cl
cxx_compiler: cl
std: 20
build_type: relwithdebinfo
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Test doc examples
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_TEST=OFF -DTBB_DOC_EXAMPLES=ON ..
cmake --build . --config ${{ matrix.build_type }} -v --parallel --target build-doc-examples
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure -L doc-examples
|