add a new test-args action input for passing additional arguments during the CTest run

This commit is contained in:
Alfi Maulana 2023-01-22 12:44:19 +07:00
parent 633b25cfad
commit 03870ba3b0
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4
2 changed files with 7 additions and 0 deletions

View File

@ -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.

View File

@ -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