From 8d8282bac36cde915bbbdd2272ea1ff437516bb6 Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Wed, 10 Nov 2021 13:54:29 -0700 Subject: [PATCH] Add Static Analysis action to run on Pull Request Unit test source files are not currently checked. Hopefully, these can be added so that all source files in a pull request are verified. Signed-off-by: Sean Robinson --- .github/workflows/static_analysis.yml | 42 +++++++++++++++++++++++++++ tools/static_analysis_setup.sh | 4 +++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/static_analysis.yml create mode 100755 tools/static_analysis_setup.sh diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml new file mode 100644 index 0000000..0d47ee1 --- /dev/null +++ b/.github/workflows/static_analysis.yml @@ -0,0 +1,42 @@ + +name: Static Analysis + +on: pull_request + +jobs: + + static_analysis: + + name: ${{ matrix.toolchain }} + runs-on: ${{ matrix.os }} + + strategy: + + matrix: + + toolchain: + - ubuntu-latest + + include: + - toolchain: ubuntu-latest + os: ubuntu-latest + compiler: clang + + steps: + + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Analyze + uses: JacobDomagala/StaticAnalysis@master + with: + clang_tidy_args: >- + --config-file=$GITHUB_WORKSPACE/.clang-tidy + --extra-arg=-I$GITHUB_WORKSPACE/include --extra-arg=-std=c++17 + cppcheck_args: >- + --enable=all --inconclusive --inline-suppr + -i$GITHUB_WORKSPACE/test/main.cpp + -i$GITHUB_WORKSPACE/test/test_*.cpp + --suppress=missingInclude + --suppress='*:$GITHUB_WORKSPACE/test/doctest.hpp' + init_script: tools/static_analysis_setup.sh diff --git a/tools/static_analysis_setup.sh b/tools/static_analysis_setup.sh new file mode 100755 index 0000000..cd0dc06 --- /dev/null +++ b/tools/static_analysis_setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Change to the "test" subdir before "build" subdir is made. +cd test