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 f081a07
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ 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: sudo pipx install CodeChecker --force

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

Expand All @@ -49,12 +52,21 @@ jobs:
- 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_clangsa ./Docs/Generated/html
mv ./Sast/html_cppcheck ./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
4 changes: 4 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Full documentation available [here](https://mrognor.github.io/MVault/index.html)
Test coverage available [here](https://mrognor.github.io/MVault/Coverage/CodeCoverage.html)
Sast clang_tidy available [here](https://mrognor.github.io/MVault/html_clang_tidy/index.html#sort=file-path&asc=1)
Sast clangsa available [here](https://mrognor.github.io/MVault/html_clangsa/index.html#sort=file-path&asc=1)
Sast cppcheck available [here](https://mrognor.github.io/MVault/cppcheck/index.html#sort=file-path&asc=1)


# Configure project
Cmake is used to configure the project. It is called via the **Configure** script.
Expand Down
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
20 changes: 20 additions & 0 deletions Scripts/RunSast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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

echo "Finish sast"

0 comments on commit f081a07

Please sign in to comment.