Skip to content

Add SYCL support

Add SYCL support #1386

name: Static analysis
on: [pull_request]
jobs:
clang-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install prerequisites
run: |
sudo apt install clang libomp-dev
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build --parallel
- name: Run clang-tidy
run: |
python3 - <<'PY'
import json
from pathlib import Path
compile_commands = json.loads(Path("build/compile_commands.json").read_text())
sources = sorted(
{
entry["file"]
for entry in compile_commands
if "/app/" in entry["file"] or "/src/" in entry["file"]
}
)
Path("build/clang_tidy_sources.txt").write_text("\n".join(sources) + "\n")
PY
xargs -a build/clang_tidy_sources.txt clang-tidy -format-style=file -header-filter="($PWD/include/.*|$PWD/src/.*|$PWD/app/.*)" -p build