diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml new file mode 100644 index 000000000..47e926287 --- /dev/null +++ b/.github/workflows/static_analysis.yml @@ -0,0 +1,25 @@ +name: Static analysis + +on: [pull_request] + +jobs: + static_analysis: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Run static analysis + uses: esp-cpp/StaticAnalysis@master + with: + # Do not build the project and do not use cmake to generate compile_commands.json + use_cmake: false + + # Use the 5.2 release version since it's what we build with + esp_idf_version: release/v5.2 + + # (Optional) cppcheck args + cppcheck_args: -i$GITHUB_WORKSPACE/lib -i$GITHUB_WORKSPACE/external -i$GITHUB_WORKSPACE/components/esp_littlefs -i$GITHUB_WORKSPACE/components/lvgl -i$GITHUB_WORKSPACE/components/esp-dsp --force --enable=all --inline-suppr --inconclusive --platform=mips32 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt diff --git a/suppressions.txt b/suppressions.txt new file mode 100644 index 000000000..f33b92dcc --- /dev/null +++ b/suppressions.txt @@ -0,0 +1,11 @@ +// category of errors to suppress, e.g. unusedFunction +missingInclude +missingIncludeSystem +unusedFunction +unusedStructMember +functionStatic +// cstyleCast + +// Specific suppressions of the form: +// [error id]:[filename]:[line] +*:lib/*