Update action.yml

This commit is contained in:
2025-08-19 16:26:04 +02:00
parent 5888750b44
commit eee9537946
+28 -23
View File
@@ -56,6 +56,11 @@ inputs:
required: false
default: ""
session-wrapper:
description: "Wrapper de session (ex: dbus-run-session --)"
required: false
default: ""
pre-test-cmd:
description: "Commands to run before pytest (e.g. start Xvfb, dunst, sleep, export DISPLAY)"
required: false
@@ -233,38 +238,38 @@ runs:
pip|custom) ;; # pytest doit déjà être dans le PATH
esac
bash -c "
WRAP="${{ inputs.session-wrapper }} bash -c"
$WRAP '
set -e
# Pré-test
if [ -n '${{ inputs.pre-test-cmd }}' ]; then
echo '▶️ Running pre-test commands...' | tee -a $LOG_FILE
eval \"${{ inputs.pre-test-cmd }}\"
if [ -n "${{ inputs.pre-test-cmd }}" ]; then
echo "▶️ Running pre-test commands..." | tee -a $LOG_FILE
eval "${{ inputs.pre-test-cmd }}" >> $LOG_FILE 2>&1
fi
set +e
# Run tests
if [ -n '${{ inputs.test-run-cmd }}' ]; then
echo '▶️ Running tests with wrapper: ${{ inputs.test-run-cmd }}' | tee -a $LOG_FILE
eval \"${{ inputs.test-run-cmd }} \\\"$CMD\\\"\"
STATUS=\$?
if [ -n "${{ inputs.test-run-cmd }}" ]; then
echo "▶️ Running tests with wrapper: ${{ inputs.test-run-cmd }}" | tee -a $LOG_FILE
FULL_CMD="${{ inputs.test-run-cmd }} \"$CMD\""
bash -c "$FULL_CMD" >> outputs/full-output.log 2>&1
STATUS=$?
else
echo '▶️ Running tests (direct)' | tee -a $LOG_FILE
eval \"$CMD\"
STATUS=\$?
echo "▶️ Running tests (direct)" | tee -a $LOG_FILE
bash -c "$CMD" >> outputs/full-output.log 2>&1
STATUS=$?
fi
set -e
# Post-test
if [ -n '${{ inputs.post-test-cmd }}' ]; then
echo '▶️ Running post-test commands...' | tee -a $LOG_FILE
eval \"${{ inputs.post-test-cmd }}\"
fi
exit \$STATUS
" >> outputs/full-output.log 2>&1
echo "▶️ END"
if [ -n "${{ inputs.post-test-cmd }}" ]; then
echo "▶️ Running post-test commands..." | tee -a $LOG_FILE
eval "${{ inputs.post-test-cmd }}" >> $LOG_FILE 2>&1
fi
echo "▶️ END" | tee -a $LOG_FILE
exit $STATUS
'
cat outputs/full-output.log
awk '/=+ test session starts =+/{flag=1} /-+ JSON report -+/{flag=0} flag' outputs/full-output.log > outputs/raw-test-output.log