Skip to content

Commit

Permalink
feat: add build-config action input
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Mar 20, 2024
1 parent 8452526 commit 7ad64b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Test Project
uses: ./ctest-action
with:
args: ${{ matrix.os == 'windows' && '-C Debug' || '' }}
build-config: ${{ matrix.os == 'windows' && 'Debug' || '' }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ 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:
using: composite
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 }}

0 comments on commit 7ad64b6

Please # to comment.