4 task adr template #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Clang Tidy Check | |
on: | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
clang-tidy: | |
name: Clang Tidy Analysis | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Install clang-tidy | |
- name: Install clang-tidy | |
run: sudo apt-get install -y clang-tidy | |
# Find and process each subdirectory with a CMakeLists.txt | |
- name: Configure and Build Projects | |
run: | | |
for dir in $(find . -name CMakeLists.txt -exec dirname {} \;); do | |
mkdir -p $dir/build | |
cd $dir/build | |
cmake -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. | |
make | |
cd - | |
done | |
# Run clang-tidy check for all projects | |
- name: Run clang-tidy | |
run: | | |
for dir in $(find . -name compile_commands.json -exec dirname {} \;); do | |
clang-tidy -p=$dir $(find $dir -name '*.cpp') --quiet | |
done |