Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/testo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ on:
type: string
testo-additional-args:
description: Additional Testo arguments, separated by whitespace.
default: "--log-junit=junit.xml"
default: ""
required: false
type: string
testo-configuration:
Expand All @@ -104,6 +104,11 @@ on:
default:
required: false
type: string
testo-junit-file:
description: JUnit report file, passed with `--log-junit` and uploaded to Codecov as test results; empty disables it.
default: junit.xml
required: false
type: string
testo-path:
description: Path to the Testo executable.
default: vendor/bin/testo
Expand Down Expand Up @@ -191,6 +196,7 @@ jobs:
exclude-group: ${{ inputs.testo-exclude-group }}
filter: ${{ inputs.testo-filter }}
group: ${{ inputs.testo-group }}
junit-file: ${{ inputs.testo-junit-file }}
path: ${{ inputs.testo-path }}
suite: ${{ inputs.testo-suite }}
type: ${{ inputs.testo-type }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## v3.0.2 Under development

- feat(testo): add junit-file input for JUnit report and update additional args handling.

## v3.0.1 October 26, 2026

- ci(actions): add the reusable `testo.yml` workflow and the `testo` composite action to run Testo suites with coverage and Codecov uploads.
Expand Down
10 changes: 8 additions & 2 deletions actions/phpunit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ runs:
PHPUNIT_CMD="$PHPUNIT_CMD $DEBUG_INPUT"
fi

# Line breaks are replaced with spaces so the command stays a single `GITHUB_OUTPUT` line.
if [ -n "$ADDITIONAL_ARGS" ]; then
PHPUNIT_CMD="$PHPUNIT_CMD $ADDITIONAL_ARGS"
PHPUNIT_CMD="$PHPUNIT_CMD ${ADDITIONAL_ARGS//[$'\r\n']/ }"
fi

echo "command=$PHPUNIT_CMD" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -116,7 +117,12 @@ runs:
report_type: test_results

- name: Upload coverage to Codecov.
if: ${{ !cancelled() && inputs.coverage-driver != 'none' }}
if: >-
${{
!cancelled()
&& inputs.coverage-driver != ''
&& inputs.coverage-driver != 'none'
}}
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
token: ${{ inputs.coverage-token }}
Expand Down
23 changes: 19 additions & 4 deletions actions/testo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Run Testo tests with coverage and configurable options.
inputs:
additional-args:
description: Additional Testo arguments, separated by whitespace.
default: "--log-junit=junit.xml"
default: ""
required: false
configuration:
description: Testo configuration file, passed with `--config`.
Expand Down Expand Up @@ -39,6 +39,10 @@ inputs:
description: Group to run, passed with `--group`.
default: ""
required: false
junit-file:
description: JUnit report file, passed with `--log-junit` and uploaded to Codecov as test results; empty disables it.
default: junit.xml
required: false
path:
description: Path to the Testo executable.
default: vendor/bin/testo
Expand Down Expand Up @@ -67,6 +71,7 @@ runs:
EXCLUDE_GROUP_INPUT: ${{ inputs.exclude-group }}
FILTER_INPUT: ${{ inputs.filter }}
GROUP_INPUT: ${{ inputs.group }}
JUNIT_FILE: ${{ inputs.junit-file }}
PATH_INPUT: ${{ inputs.path }}
SUITE_INPUT: ${{ inputs.suite }}
TYPE_INPUT: ${{ inputs.type }}
Expand All @@ -85,6 +90,7 @@ runs:
args+=("--coverage-$COVERAGE_FORMAT=$COVERAGE_FILE")
fi

add_param "--log-junit" "$JUNIT_FILE"
add_param "--config" "$CONFIG_INPUT"
add_param "--suite" "$SUITE_INPUT"
add_param "--filter" "$FILTER_INPUT"
Expand All @@ -97,8 +103,9 @@ runs:
add_param "--type" "$TYPE_INPUT"

# Additional arguments are whitespace-separated; each word is passed as one argument.
# Line breaks are replaced with spaces so multi-line values split like the Windows step.
if [ -n "$ADDITIONAL_ARGS" ]; then
read -r -a extra <<< "$ADDITIONAL_ARGS"
read -r -a extra <<< "${ADDITIONAL_ARGS//[$'\r\n']/ }"

if [ "${#extra[@]}" -gt 0 ]; then
args+=("${extra[@]}")
Expand All @@ -123,6 +130,7 @@ runs:
EXCLUDE_GROUP_INPUT: ${{ inputs.exclude-group }}
FILTER_INPUT: ${{ inputs.filter }}
GROUP_INPUT: ${{ inputs.group }}
JUNIT_FILE: ${{ inputs.junit-file }}
PATH_INPUT: ${{ inputs.path }}
SUITE_INPUT: ${{ inputs.suite }}
TYPE_INPUT: ${{ inputs.type }}
Expand All @@ -139,6 +147,7 @@ runs:
$testoArgs += "--coverage-$($env:COVERAGE_FORMAT)=$($env:COVERAGE_FILE)"
}

Add-Param '--log-junit' $env:JUNIT_FILE
Add-Param '--config' $env:CONFIG_INPUT
Add-Param '--suite' $env:SUITE_INPUT
Add-Param '--filter' $env:FILTER_INPUT
Expand All @@ -164,14 +173,20 @@ runs:
}

- name: Upload test results to Codecov.
if: ${{ !cancelled() }}
if: ${{ !cancelled() && inputs.junit-file != '' }}
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
token: ${{ inputs.coverage-token }}
files: ./${{ inputs.junit-file }}
report_type: test_results

- name: Upload coverage to Codecov.
if: ${{ !cancelled() && inputs.coverage-driver != 'none' }}
if: >-
${{
!cancelled()
&& inputs.coverage-driver != ''
&& inputs.coverage-driver != 'none'
}}
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
token: ${{ inputs.coverage-token }}
Expand Down
Loading