Skip to content

Commit

Permalink
Add sast to project
Browse files Browse the repository at this point in the history
  • Loading branch information
mrognor committed Dec 2, 2024
1 parent 839c834 commit c353c85
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,35 @@ jobs:
uses: actions/configure-pages@v5

- name: Install packages
run: sudo apt-get update && sudo apt-get upgrade && sudo DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install doxygen graphviz lcov cmake
run: sudo apt-get update && sudo apt-get upgrade && sudo DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install doxygen graphviz lcov cmake pipx clang clang-tidy

- name: Install CodeChecker
run: pipx install CodeChecker --force

- name: Create documentation
run: ./Docs/Gendoc.sh

- name: Run tests
run: ./Scripts/RunTests.sh
# - name: Run tests
# run: ./Scripts/RunTests.sh

- name: Test coverage
run: ./Scripts/TestCoverage.sh
# - name: Test coverage
# run: ./Scripts/TestCoverage.sh

- name: Move coverage artifact
run: mv ./Coverage ./Docs/Generated/html
# - name: Move coverage artifact
# run: mv ./Coverage ./Docs/Generated/html

- name: Run sast
run: ./Scripts/RunSast.sh

- name: Move sast artifacts
run: mv ./Sast/html_clang_tidy ./Docs/Generated/html && mv ./Sast/html_clang_tidy ./Docs/Generated/html && mv ./Sast/html_clang_tidy ./Docs/Generated/html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload documentation
path: './Docs/Generated/html/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Docs/Generated
Docs/Examples
Build
Release
Coverage
Coverage
Sast
1 change: 1 addition & 0 deletions Scripts/Clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cd ..

rm -rf Build
rm -rf Coverage
rm -rf Sast
rm -rf Release
rm -rf Docs/Examples
rm -rf Docs/Generated
18 changes: 18 additions & 0 deletions Scripts/RunSast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Navigate to root dir
cd $(dirname "$0")
cd ..

# Navigate to sast dir
mkdir -p Sast
cd Sast

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ../Source/

CodeChecker analyze ./compile_commands.json --analyzers clangsa --enable=sensitive --output clangsa
CodeChecker parse --export html --output ./html_clangsa ./clangsa

CodeChecker analyze ./compile_commands.json --analyzers cppcheck --enable=sensitive --output cppcheck
CodeChecker parse --export html --output ./html_cppcheck ./cppcheck

CodeChecker analyze ./compile_commands.json --analyzers clang-tidy --enable=sensitive --output clang-tidy
CodeChecker parse --export html --output ./html_clang_tidy ./clang-tidy

0 comments on commit c353c85

Please sign in to comment.