diff --git a/README.md b/README.md index f478544..4e4619a 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ jobs: | `init_script` | FALSE | Optional shell script that will be run before running CMake command. This should be used, when the project requires some environmental set-up beforehand. | `` | | `cppcheck_args` | TRUE | Cppcheck (space separated) arguments that will be used |`--enable=all --suppress=missingInclude --inline-suppr --inconclusive`| | `report_pr_changes_only`| FALSE | Only post the issues found within the changes introduced in this Pull Request. This means that only the issues found within the changed lines will po posted. Any other issues caused by these changes in the repository, won't be reported, so in general you should run static analysis on entire code base |`false`| +| `cmake_args` | FALSE | Additional CMake arguments |``| diff --git a/action.yml b/action.yml index caace6b..d9cce58 100644 --- a/action.yml +++ b/action.yml @@ -33,6 +33,8 @@ inputs: report_pr_changes_only: description: 'Only post the issues found within the changes introduced in this Pull Request' default: false + cmake_args: + description: 'Additional CMake arguments' runs: using: "docker" diff --git a/entrypoint.sh b/entrypoint.sh index a0d75b3..e64dc6b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,13 +17,13 @@ if [ -n "$INPUT_INIT_SCRIPT" ]; then fi mkdir build && cd build || exit -cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. +cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "$INPUT_CMAKE_ARGS" .. if [ -z "$INPUT_EXCLUDE_DIR" ]; then - cppcheck --project=compile_commands.json $INPUT_CPPCHECK_ARGS --output-file=cppcheck.txt + eval cppcheck --project=compile_commands.json "$INPUT_CPPCHECK_ARGS" --output-file=cppcheck.txt run-clang-tidy-11 >(tee "clang_tidy.txt") else - cppcheck --project=compile_commands.json $INPUT_CPPCHECK_ARGS --output-file=cppcheck.txt -i"$GITHUB_WORKSPACE/$INPUT_EXCLUDE_DIR" + eval cppcheck --project=compile_commands.json "$INPUT_CPPCHECK_ARGS" --output-file=cppcheck.txt -i"$GITHUB_WORKSPACE/$INPUT_EXCLUDE_DIR" run-clang-tidy-11 "^((?!$GITHUB_WORKSPACE/$INPUT_EXCLUDE_DIR).)*$" > clang_tidy.txt fi