|
| 1 | +# Copyright (C) 2021 Intel Corporation |
| 2 | +# SPDX-License-Identifier: BSD-3-Clause |
| 3 | + |
| 4 | +# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions |
| 5 | + |
| 6 | +name: thread sanitizer |
| 7 | + |
| 8 | +# https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/ |
| 9 | +permissions: |
| 10 | + # Grant read permissions to repository in case it is not a forked public |
| 11 | + # repository, but a private repository that was created manually. |
| 12 | + contents: read |
| 13 | + |
| 14 | + # Grant read permissions to private container images. |
| 15 | + packages: read |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + paths: |
| 20 | + - '**' |
| 21 | + - '!**.md' |
| 22 | + - '!**/.clang-format' |
| 23 | + - '!**/COPYING' |
| 24 | + - '!**/LICENSE' |
| 25 | + - '!.github/**' |
| 26 | + - '.github/workflows/tsan.yml' |
| 27 | + - '!.gitignore' |
| 28 | + - '!cmake/manifests/**' |
| 29 | + - 'cmake/manifests/linux/**' |
| 30 | + - '!container/**' |
| 31 | + - '!docs/**' |
| 32 | + - '!scripts/**' |
| 33 | + |
| 34 | + pull_request: |
| 35 | + paths: |
| 36 | + - '**' |
| 37 | + - '!**.md' |
| 38 | + - '!**/.clang-format' |
| 39 | + - '!**/COPYING' |
| 40 | + - '!**/LICENSE' |
| 41 | + - '!.github/**' |
| 42 | + - '.github/workflows/tsan.yml' |
| 43 | + - '!.gitignore' |
| 44 | + - '!cmake/manifests/**' |
| 45 | + - 'cmake/manifests/linux/**' |
| 46 | + - '!container/**' |
| 47 | + - '!docs/**' |
| 48 | + - '!scripts/**' |
| 49 | + |
| 50 | +jobs: |
| 51 | + build: |
| 52 | + runs-on: ubuntu-20.04 |
| 53 | + |
| 54 | + container: |
| 55 | + image: ghcr.io/intel/fpga-runtime-for-opencl/ubuntu-20.04-dev:main |
| 56 | + |
| 57 | + continue-on-error: true |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: change ownership of workspace to current user |
| 61 | + run: sudo chown -R build:build . |
| 62 | + |
| 63 | + - name: checkout code |
| 64 | + uses: actions/checkout@v2 |
| 65 | + |
| 66 | + - name: query distribution |
| 67 | + run: cat /etc/os-release |
| 68 | + |
| 69 | + - name: create build directory |
| 70 | + run: mkdir build |
| 71 | + |
| 72 | + - name: create build files |
| 73 | + run: | |
| 74 | + cd build |
| 75 | + cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug -DACL_TSAN=ON |
| 76 | + env: |
| 77 | + CC: gcc |
| 78 | + CXX: g++ |
| 79 | + |
| 80 | + - name: build runtime |
| 81 | + run: | |
| 82 | + cd build |
| 83 | + ninja -v -k0 |
| 84 | +
|
| 85 | + - name: test runtime |
| 86 | + run: | |
| 87 | + cd build |
| 88 | + ctest -V |
| 89 | +
|
| 90 | + - name: tsan result |
| 91 | + uses: actions/upload-artifact@v2 |
| 92 | + if: always() |
| 93 | + with: |
| 94 | + name: tsan-report |
| 95 | + path: build/Testing/Temporary/LastTest.log |
| 96 | + |
| 97 | + - name: revert ownership of workspace to root |
| 98 | + run: sudo chown -R root:root . |
| 99 | + if: always() |
0 commit comments