Skip to content

Commit 975c16b

Browse files
author
Greg Bowler
committed
build: use output_log
1 parent 2cb88aa commit 975c16b

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ inputs:
8181
description: Extra arguments to pass to the phpunit binary
8282
required: false
8383

84+
outputs:
85+
output_log:
86+
description: An output log of the build process
87+
8488
runs:
8589
using: "composite"
8690
steps:
@@ -105,8 +109,10 @@ runs:
105109
ACTION_MEMORY_LIMIT: ${{ inputs.memory_limit }}
106110
ACTION_ARGS: ${{ inputs.args }}
107111
id: phpunit_run
108-
run: bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) phpunit \
109-
&& ${{ github.action_path }}/phpunit-action.bash || { cat ${{ github.workspace }}/output.log >> $GITHUB_OUTPUT ; exit 1; }
112+
run: |
113+
set -e
114+
bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) phpunit
115+
${{ github.action_path }}/phpunit-action.bash >> $GITHUB_OUTPUT
110116
shell: bash
111117

112118
branding:

phpunit-action.bash

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
set -e
33
github_action_path=$(dirname "$0")
44
docker_tag=$(cat ./docker_tag)
5-
echo "Docker tag: $docker_tag" >> output.log 2>&1
5+
echo "output_log=Docker tag: $docker_tag"
66

77
if [ -n "$ACTION_PHPUNIT_PATH" ]
88
then
9-
echo "Using phar" >> output.log 2>&1
9+
echo "output_log=Using phar"
1010
phar_url="https://phar.phpunit.de/phpunit"
1111
if [ "$ACTION_VERSION" != "latest" ]
1212
then
@@ -19,7 +19,7 @@ then
1919
phar_path="${github_action_path}/phpunit.phar"
2020
else
2121
phar_path="${GITHUB_WORKSPACE}/$ACTION_PHPUNIT_PATH"
22-
echo "Using vendored phpunit: $phar_path" >> output.log 2>&1
22+
echo "output_log=Using vendored phpunit: $phar_path"
2323
fi
2424

2525
command_string=("phpunit")
@@ -94,8 +94,7 @@ then
9494
command_string+=($ACTION_ARGS)
9595
fi
9696

97-
98-
echo "Command: " "${command_string[@]}" >> output.log 2>&1
97+
echo "output_log=Command: " "${command_string[@]}"
9998

10099
docker run --rm \
101100
--volume "${phar_path}":/usr/local/bin/phpunit \

0 commit comments

Comments
 (0)