CI changes, added static analysis #1
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: Static Analysys(Cppcheck, Clang-Tidy) | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
cppcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run Cppcheck | |
run: | | |
sudo apt-get install -y cppcheck | |
cppcheck --enable=all --inconclusive --force --language=c++ --file-list=<(find lwlog/src/ -name "*.cpp" -o -name "*.h") &> static_analysis/cppcheck.txt | |
continue-on-error: true | |
- name: Upload Cppcheck Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cppcheck_results | |
path: static_analysis/cppcheck.txt | |
clang-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download GCC build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: compile_commands_json | |
path: ./build | |
- name: Run Clang-Tidy | |
run: | | |
sudo apt-get install -y clang-tidy | |
find lwlog/src/ -name "*.cpp" -o -name "*.h" | xargs clang-tidy -p=build/compile_commands.json &> static_analysis/clang-tidy.txt | |
continue-on-error: true | |
- name: Upload Clang-Tidy Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: clangtidy_results | |
path: static_analysis/clang-tidy.txt |