1# Copyright (c) 2021 Intel Corporation 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15name: oneTBB CI 16 17on: 18 push: 19 branches: [master] 20 21 pull_request: 22 branches: [master] 23 types: 24 - opened 25 - synchronize 26 - reopened 27 28env: 29 BUILD_CONCURRENCY: 2 30 MACOS_BUILD_CONCURRENCY: 3 31 TEST_TIMEOUT: 180 32 33jobs: 34 codespell: 35 runs-on: [ubuntu-20.04] 36 timeout-minutes: 10 37 steps: 38 - uses: actions/checkout@v2 39 - name: Run scan 40 run: | 41 sudo apt update && sudo apt install -y codespell 42 ${GITHUB_WORKSPACE}/.github/scripts/codespell.sh `pwd` 43 44 examples_clang-format: 45 runs-on: [ubuntu-20.04] 46 timeout-minutes: 10 47 steps: 48 - uses: actions/checkout@v2 49 - name: Run scan 50 run: | 51 command -v clang-format-10 52 cp -r examples examples_formatted 53 find examples_formatted -regex '.*\.\(cpp\|hpp\)' -exec clang-format-10 -style=file -i {} \; 54 diff -r examples examples_formatted 55 56 documentation: 57 needs: [codespell] 58 env: 59 BUILD_TYPE: oss 60 runs-on: [ubuntu-20.04] 61 timeout-minutes: 10 62 steps: 63 - uses: actions/checkout@v2 64 - name: Install prerequisites 65 run: | 66 pip3 install git+https://github.com/executablebooks/sphinx-book-theme.git 67 echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV 68 mkdir html 69 - name: Build documentation 70 run: | 71 export BUILD_TYPE=${BUILD_TYPE} && sphinx-build doc/main html 72 tar -czvf html.tar.gz html/ 73 - name: Save docs 74 uses: actions/upload-artifact@v2.2.1 75 with: 76 name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }} 77 path: html.tar.gz 78 79 pages: 80 if: ${{ github.ref == 'refs/heads/master' }} 81 runs-on: ubuntu-latest 82 needs: [documentation] 83 steps: 84 - name: Checkout gh-pages 85 uses: actions/checkout@v2 86 with: 87 ref: gh-pages 88 path: gh-pages 89 - name: Set env 90 run: echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV 91 - name: Download documetation 92 uses: actions/download-artifact@v2 93 with: 94 name: oneTBB-html-docs-${{ env.GITHUB_SHA_SHORT }} 95 - name: Publish to github pages 96 run: | 97 tar -xvf html.tar.gz 98 cd gh-pages 99 rm -rf * 100 touch .nojekyll # https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/ 101 cp -r ../html/* . 102 git config user.name github-actions 103 git config user.email [email protected] 104 git add . 105 git commit --reset-author --amend -m "Update from GitHub Actions" 106 git push --force origin gh-pages 107 108 python_module_test_ubuntu18-04: 109 runs-on: [ubuntu-18.04] 110 timeout-minutes: 15 111 steps: 112 - uses: actions/checkout@v2 113 - name: Run testing 114 run: | 115 mkdir build && cd build 116 cmake -DTBB4PY_BUILD=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc .. 117 make VERBOSE=1 -j${BUILD_CONCURRENCY} python_build 118 ctest -R python_test --output-on-failure --timeout ${TEST_TIMEOUT} 119 120 linux-testing: 121 name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }} 122 runs-on: ['${{ matrix.os }}'] 123 timeout-minutes: 45 124 strategy: 125 fail-fast: false 126 matrix: 127 include: 128 - os: ubuntu-18.04 129 c_compiler: gcc 130 cxx_compiler: g++ 131 std: 14 132 build_type: relwithdebinfo 133 preview: 'OFF' 134 - os: ubuntu-20.04 135 c_compiler: gcc 136 cxx_compiler: g++ 137 std: 17 138 build_type: release 139 preview: 'ON' 140 - os: ubuntu-20.04 141 c_compiler: gcc-10 142 cxx_compiler: g++-10 143 std: 20 144 build_type: debug 145 preview: 'ON' 146 steps: 147 - uses: actions/checkout@v2 148 - name: Run testing 149 shell: bash 150 run: | 151 set -x 152 mkdir build && cd build 153 cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ 154 -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} .. 155 make VERBOSE=1 -j${BUILD_CONCURRENCY} 156 ctest --timeout ${TEST_TIMEOUT} --output-on-failure 157 158 macos-testing: 159 name: ${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }} 160 runs-on: ['${{ matrix.os }}'] 161 timeout-minutes: 45 162 strategy: 163 fail-fast: false 164 matrix: 165 include: 166 - os: macos-10.15 167 c_compiler: clang 168 cxx_compiler: clang++ 169 std: 14 170 build_type: relwithdebinfo 171 preview: 'ON' 172 steps: 173 - uses: actions/checkout@v2 174 - name: Run testing 175 shell: bash 176 run: | 177 set -x 178 mkdir build && cd build 179 cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ 180 -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} .. 181 make VERBOSE=1 -j${MACOS_BUILD_CONCURRENCY} 182 ctest --timeout ${TEST_TIMEOUT} --output-on-failure 183 184 windows-testing: 185 name: ${{ matrix.job_name }} 186 runs-on: ['${{ matrix.os }}'] 187 timeout-minutes: 45 188 strategy: 189 fail-fast: false 190 matrix: 191 include: 192 - os: windows-2016 193 generator: Visual Studio 15 2017 194 c_compiler: cl 195 cxx_compiler: cl 196 std: 14 197 build_type: relwithdebinfo 198 preview: 'ON' 199 job_name: windows_cl2017_cxx14_relwithdebinfo_preview=ON 200 - os: windows-2019 201 generator: Visual Studio 16 2019 202 c_compiler: cl 203 cxx_compiler: cl 204 std: 17 205 build_type: relwithdebinfo 206 preview: 'OFF' 207 job_name: windows_cl2019_cxx17_relwithdebinfo_preview=OFF 208 steps: 209 - uses: actions/checkout@v2 210 - name: Run testing 211 run: | 212 mkdir build 213 cd build 214 cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} ` 215 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} ` 216 -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} .. 217 cmake --build . --config ${{ matrix.build_type }} -j -v 218 ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure 219 220 linux-examples-testing: 221 name: examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }} 222 runs-on: ['${{ matrix.os }}'] 223 timeout-minutes: 20 224 strategy: 225 fail-fast: false 226 matrix: 227 include: 228 - os: ubuntu-18.04 229 c_compiler: gcc 230 cxx_compiler: g++ 231 std: 14 232 build_type: relwithdebinfo 233 preview: 'OFF' 234 - os: ubuntu-20.04 235 c_compiler: gcc 236 cxx_compiler: g++ 237 std: 17 238 build_type: release 239 preview: 'ON' 240 - os: ubuntu-20.04 241 c_compiler: gcc-10 242 cxx_compiler: g++-10 243 std: 20 244 build_type: debug 245 preview: 'ON' 246 steps: 247 - uses: actions/checkout@v2 248 - name: Run testing 249 shell: bash 250 run: | 251 set -x 252 mkdir build && cd build 253 cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ 254 -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ 255 -DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON .. 256 cmake --build . -v --target light_test_examples 257 258 macos-examples-testing: 259 name: examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}_preview=${{ matrix.preview }} 260 runs-on: ['${{ matrix.os }}'] 261 timeout-minutes: 20 262 strategy: 263 fail-fast: false 264 matrix: 265 include: 266 - os: macos-10.15 267 c_compiler: clang 268 cxx_compiler: clang++ 269 std: 14 270 build_type: relwithdebinfo 271 preview: 'ON' 272 steps: 273 - uses: actions/checkout@v2 274 - name: Run testing 275 shell: bash 276 run: | 277 set -x 278 mkdir build && cd build 279 cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ 280 -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ 281 -DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON .. 282 cmake --build . -v --target light_test_examples 283 284 windows-examples-testing: 285 name: ${{ matrix.job_name }} 286 runs-on: ['${{ matrix.os }}'] 287 timeout-minutes: 20 288 strategy: 289 fail-fast: false 290 matrix: 291 include: 292 - os: windows-2016 293 generator: Visual Studio 15 2017 294 c_compiler: cl 295 cxx_compiler: cl 296 std: 14 297 build_type: relwithdebinfo 298 preview: 'ON' 299 job_name: examples_windows_cl2017_cxx14_relwithdebinfo_preview=ON 300 - os: windows-2019 301 generator: Visual Studio 16 2019 302 c_compiler: cl 303 cxx_compiler: cl 304 std: 17 305 build_type: relwithdebinfo 306 preview: 'OFF' 307 job_name: examples_windows_cl2019_cxx17_relwithdebinfo_preview=OFF 308 steps: 309 - uses: actions/checkout@v2 310 - name: Run testing 311 run: | 312 mkdir build 313 cd build 314 cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} ` 315 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} ` 316 -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON .. 317 cmake --build . -v --target light_test_examples 318