#24 added include for stream #62
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 ./tests/*.cpp -checks='*' >> ./clang-tidy-report.txt | |
| #clang-tidy ./tests/*.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 > ./suspect-words-report.txt | |
| #python3 ./scripts/check_suspect_words.py "./tools" --marker-file ./scripts/check_suspect_words.txt >> ./suspect-words-report.txt | |
| python3 ./scripts/check_suspect_words.py "./tests" --marker-file ./scripts/check_suspect_words.txt >> ./suspect-words-report.txt | |
| - name: Upload suspect words report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./suspect-words-report.txt | |
| name: suspect-words-report.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 > ./boilerplate-report.txt | |
| #python3 ./scripts/check_boilerplate.py --src "./tools" --boilerplate ./scripts/check_boilerplate.txt >> ./boilerplate-report.txt | |
| python3 ./scripts/check_boilerplate.py --src "./tests" --boilerplate ./scripts/check_boilerplate.txt >> ./boilerplate-report.txt | |
| - name: Upload boilerplate report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./boilerplate-report.txt | |
| name: boilerplate-report.txt | |
| - name: Check for large files | |
| # This step checks for large files in the codebase | |
| run: | | |
| python3 ./scripts/check_file_size.py "./src" 500 "//" .cpp .h > ./file-size-report.txt | |
| #python3 ./scripts/check_file_size.py "./tools" 500 "#" .py >> ./file-size-report.txt | |
| python3 ./scripts/check_file_size.py "./tests" 500 "//" .cpp .h >> ./file-size-report.txt | |
| - name: Upload file size report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./file-size-report.txt | |
| name: file-size-report.txt | |
| - name: CMake Format check | |
| run: | | |
| echo "==================Installing cmake-format=====================================" | |
| pip install cmake-format | |
| echo "==================Running cmake-format=====================================" | |
| FILES=$(find . -name "CMakeLists.txt" | grep -vE "(^./CMakeFiles/.|^./_deps/)") | |
| cmake-format --check $FILES >> ./cmake-format-report.txt | |
| echo "==================Uploading cmake-format report=====================================" | |
| cat ./cmake-format-report.txt | |
| - name: Upload cmake-format report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./cmake-format-report.txt | |
| name: cmake-format-report.txt | |
| - name: CMake Linter check | |
| run: | | |
| echo "==================Installing cmake-lint-format=====================================" | |
| pip install cmakelint | |
| echo "==================Running cmakelint=====================================" | |
| FILES=$(find . -name "CMakeLists.txt" | grep -vE "(^./CMakeFiles/.|^./_deps/)") | |
| : > ./cmakelint-format-report.txt | |
| for file in $FILES; do | |
| { | |
| echo "===== $file =====" | |
| cmakelint "$file" | |
| echo | |
| } >> ./cmakelint-format-report.txt 2>&1 || true | |
| done | |
| - name: Upload cmakelint-format report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./cmakelint-format-report.txt | |
| name: cmakelint-format-report.txt | |
| - name: MarkDown Lint check | |
| continue-on-error: true | |
| run: | | |
| echo "==================Installing markdownlint-cli=====================================" | |
| npm install -g markdownlint-cli | |
| echo "==================Running markdownlint=====================================" | |
| markdownlint "**/*.md" > ./markdownlint-report.txt 2>&1 | |
| - name: Upload markdownlint report to git hub storage to use later | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./markdownlint-report.txt | |
| name: markdownlint-report.txt |