# 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