-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.79 KB
/
static-analysis.yml
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
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: Download and extract TensorFlow
run: |
wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.7.0.tar.gz
tar -xzvf libtensorflow-cpu-linux-x86_64-2.7.0.tar.gz
- name: Set TensorFlow environment variables
run: |
echo "TensorFlow_INCLUDE_DIRS=${PWD}/include" >> $GITHUB_ENV
echo "TensorFlow_LIBRARIES=${PWD}/lib/libtensorflow.so" >> $GITHUB_ENV
echo "export TensorFlow_INCLUDE_DIRS=${PWD}/include" >> $GITHUB_ENV
echo "export TensorFlow_LIBRARIES=${PWD}/lib/libtensorflow.so" >> $GITHUB_ENV
- name: Display TensorFlow environment variables
run: |
echo "TensorFlow_INCLUDE_DIRS: ${{ env.TensorFlow_INCLUDE_DIRS }}"
echo "TensorFlow_LIBRARIES: ${{ env.TensorFlow_LIBRARIES }}"
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S . -B build \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DTensorFlow_INCLUDE_DIRS=$TensorFlow_INCLUDE_DIRS \
-DTensorFlow_LIBRARIES=$TensorFlow_LIBRARIES
cmake --build build --parallel
- name: Run clang-tidy
run: |
clang-tidy app/**/*.cpp src/**/*.cpp -format-style=file -header-filter="($PWD/include/.*|$PWD/src/.*|$PWD/app/.*)" -p build