From 03870ba3b09bcdad90044cf60fe5d8c4ea670398 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Sun, 22 Jan 2023 12:44:19 +0700 Subject: [PATCH] add a new `test-args` action input for passing additional arguments during the CTest run --- README.md | 1 + action.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index a6b4d81..5923fd7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ For more information, see [action.yml](./action.yml) and [GitHub Actions guide]( | `c-flags` | Multiple strings | Additional flags passed when compiling C language files. | | `cxx-flags` | Multiple strings | Additional flags passed when compiling C++ language files. | | `args` | Multiple strings | Additional arguments passed during the CMake configuration. | +| `test-args` | Multiple strings | Additional arguments passed during the CTest run. | > Note: Multiple strings mean that the input could be specified with more than one value. Separate each value with a space or a new line. diff --git a/action.yml b/action.yml index 8a5be0a..3759521 100644 --- a/action.yml +++ b/action.yml @@ -36,6 +36,9 @@ inputs: args: description: Additional arguments passed during the CMake configuration required: false + test-args: + description: Additional arguments passed during the CTest run + required: false runs: using: composite steps: @@ -80,6 +83,9 @@ runs: if [ -n '${{ inputs.args }}' ]; then ARGS="$ARGS ${{ inputs.args }}" fi + if [ -n '${{ inputs.test-args }}' ]; then + TEST_ARGS="$TEST_ARGS ${{ inputs.test-args }}" + fi echo "cmake_args=${ARGS//[$'\t\r\n']}" >> $GITHUB_OUTPUT echo "cmake_build_args=${BUILD_ARGS//[$'\t\r\n']}" >> $GITHUB_OUTPUT echo "cmake_test_args=${TEST_ARGS//[$'\t\r\n']}" >> $GITHUB_OUTPUT