#15 fixed calling param for boilerplate.txt #32
This file contains hidden or 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: "Code Checks" | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| check-code: | |
| name: Checking code before build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout FVA repository | |
| uses: actions/checkout@v2 #v2 to checkout submodules as well | |
| with: | |
| submodules: 'true' | |
| - name: Cpp Code check | |
| uses: deep5050/cppcheck-action@main | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN}} | |
| check_library: enable | |
| max_ctu_depth: 5 | |
| - name: Upload Cpp Code check Report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./cppcheck_report.txt | |
| name: cppcheck_report.txt | |
| - name: clang-tidy check | |
| run: | | |
| echo "==================Installing clang-tidy=====================================" | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 17 | |
| sudo apt install clang-tidy-17 | |
| rm ./llvm.sh | |
| echo "==================Creating compile_commands.json=====================================" | |
| cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| echo "==================Running clang-tidy=====================================" | |
| clang-tidy ./src/*.cpp -checks='*' > ./clang-tidy-report.txt | |
| clang-tidy ./src/*.h -checks='*' >> ./clang-tidy-report.txt | |
| clang-tidy ./test/*.cpp -checks='*' >> ./clang-tidy-report.txt | |
| #clang-tidy ./test/*.h -checks='*' >> ./clang-tidy-report.txt | |
| - name: Upload clang-tidy Report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./clang-tidy-report.txt | |
| name: clang-tidy-report.txt | |
| - name: Format check | |
| run: | | |
| echo "==================Installing clang-format=====================================" | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 17 | |
| sudo apt install clang-format-17 | |
| rm ./llvm.sh | |
| echo "==================Running clang-format=====================================" | |
| for i in $(find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)' -not -path "./build/*" -not -path "./CMakeFiles/*" -not -path "./_deps/*"); do if ! clang-format-17 -style=file --dry-run --Werror "$i"; then exit 1; fi done | |
| - name: Check for suspect words | |
| # This step checks for suspect words in the codebase | |
| run: | | |
| python3 ./scripts/check_suspect_words.py "./src" --marker-file ./scripts/check_suspect_words.txt | |
| #python3 ./scripts/check_suspect_words.py "./scripts" --marker-file ./scripts/check_suspect_words.txt | |
| python3 ./scripts/check_suspect_words.py "./test" --marker-file ./scripts/check_suspect_words.txt | |
| - name: Check for boilerplate code | |
| # This step checks for boilerplate code in the codebase | |
| run: | | |
| python3 ./scripts/check_boilerplate.py --src "./src" --boilerplate ./scripts/check_boilerplate.txt | |
| python3 ./scripts/check_boilerplate.py --src "./test" --boilerplate ./scripts/check_boilerplate.txt |