-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 1.04 KB
/
clang-tidy-push.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
name: clang-tidy-push
on: [push, workflow_dispatch]
jobs:
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Clang
env:
CLANG_VERSION: ${{ vars.CLANG_VERSION }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh $CLANG_VERSION
sudo ln -f -s /usr/bin/clang-$CLANG_VERSION /usr/local/bin/cc
sudo ln -f -s /usr/bin/clang++-$CLANG_VERSION /usr/local/bin/c++
sudo ln -f -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/local/bin/clang-tidy
- name: Prepare compile_commands.json
run: |
cmake -B ${{github.workspace}}/build
ln -s ${{github.workspace}}/build/compile_commands.json ${{github.workspace}}
- name: Upload compile_commands.json
uses: actions/upload-artifact@v3
with:
name: compile_commands.json
path: compile_commands.json
- name: Run analysis
run: |
find mays -name '*.cc' -o -name '*.h' | xargs -P0 -I {} clang-tidy {}