Skip to content

Commit 4f8f087

Browse files
author
Greg Bowler
committed
feature: output to output.log for debugging on failure
1 parent 246f85d commit 4f8f087

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ runs:
108108
run: |
109109
set -e
110110
bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) phpunit
111-
echo "text<<EOF" >> $GITHUB_OUTPUT
112-
${{ github.action_path }}/phpunit-action.bash >> $GITHUB_OUTPUT
113-
echo "EOF" >> $GITHUB_OUTPUT
114-
cat $GITHUB_OUTPUT
111+
${{ github.action_path }}/phpunit-action.bash || cat ${{ github.workspace }}/output.log
115112
shell: bash
116113

117114
branding:

phpunit-action.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33
github_action_path=$(dirname "$0")
44
docker_tag=$(cat ./docker_tag)
55

6-
echo "output_log=Docker tag: $docker_tag"
6+
echo "Docker tag: $docker_tag" >> output.log 2>&1
77

88
if [ -z "$ACTION_PHPUNIT_PATH" ]
99
then
@@ -13,16 +13,16 @@ then
1313
phar_url="${phar_url}-${ACTION_VERSION}"
1414
fi
1515
phar_url="${phar_url}.phar"
16-
echo "output_log=Using phar url $phar_url"
16+
echo "Using phar url $phar_url" >> output.log 2>&1
1717

1818
phar_path="${github_action_path}/phpunit.phar"
1919
curl -H "User-agent: cURL (https://github.com/php-actions)" -L "$phar_url" > "$phar_path"
2020
else
21-
echo "output_log=Using vendored phpunit"
21+
echo "Using vendored phpunit" >> output.log 2>&1
2222
phar_path="${GITHUB_WORKSPACE}/$ACTION_PHPUNIT_PATH"
2323
fi
2424

25-
echo "output_log=phar_path=$phar_path"
25+
echo "phar_path=$phar_path" >> output.log 2>&1
2626
chmod +x $phar_path
2727
command_string=("phpunit")
2828

@@ -96,7 +96,7 @@ then
9696
command_string+=($ACTION_ARGS)
9797
fi
9898

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

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

0 commit comments

Comments
 (0)