Skip to content

Commit

Permalink
Merge pull request #11 from JacobDomagala/9-add-input-for-cmake-vars
Browse files Browse the repository at this point in the history
9: Add action input for additional CMake args
  • Loading branch information
JacobDomagala authored May 1, 2021
2 parents f58aca5 + 7d7c4b8 commit 35f9de9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | `<empty>` |
| `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 |`<empty>`|



Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 35f9de9

Please sign in to comment.