From 7ad64b67760646b359a72f60e330a1512f28c239 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 20 Mar 2024 22:13:20 +0700 Subject: [PATCH] feat: add `build-config` action input --- .github/workflows/test.yaml | 2 +- README.md | 1 + action.yaml | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 413c98a..e2f16bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,4 +33,4 @@ jobs: - name: Test Project uses: ./ctest-action with: - args: ${{ matrix.os == 'windows' && '-C Debug' || '' }} + build-config: ${{ matrix.os == 'windows' && 'Debug' || '' }} diff --git a/README.md b/README.md index 6dc4691..461093e 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ For more information, refer to [action.yml](./action.yml) and the [GitHub Action | Name | Value Type | Description | | --- | --- | --- | +| `build-config` | string | Choose the configuration to test. | | `args` | Multiple strings | Additional arguments to pass during the CTest run. | > **Note**: Multiple strings mean that the input can be specified with more than one value. Separate each value with a space or a new line. diff --git a/action.yaml b/action.yaml index cc4f5e0..5af32e3 100644 --- a/action.yaml +++ b/action.yaml @@ -5,6 +5,8 @@ branding: icon: terminal color: gray-dark inputs: + build-config: + description: Choose the configuration to test args: description: Additional arguments to pass during the CTest run runs: @@ -12,4 +14,4 @@ runs: steps: - name: Test the CMake project shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }} - run: ctest --test-dir build --output-on-failure --no-tests=error ${{ inputs.args }} + run: ctest --test-dir build --output-on-failure --no-tests=error ${{ inputs.build-config && '-C' }} ${{ inputs.build-config }} ${{ inputs.args }}