Bug Fixes and Performance Improvements #26
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: C++ Code Analysis | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-and-analyze: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install C++ tools | |
run: sudo apt-get update && sudo apt-get install -y clang clang-tidy cppcheck cmake | |
- name: List directory contents | |
run: ls -R | |
- name: Check for CMakeLists.txt | |
run: | | |
if [ ! -f ./CMakeLists.txt ]; then | |
echo "CMakeLists.txt not found in the root directory." | |
exit 1 | |
fi | |
- name: Create build directory | |
run: mkdir build | |
- name: Run CMake | |
run: cmake -S . -B build | |
- name: Build project | |
run: cmake --build build | |
- name: Run cppcheck | |
run: cppcheck --enable=all --inconclusive --xml --xml-version=2 . 2> cppcheck-result.xml | |
- name: Run clang-tidy | |
run: find . -name '*.cpp' | xargs clang-tidy -p build | |
- name: Upload cppcheck results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cppcheck-result | |
path: cppcheck-result.xml |