forked from rook/rook
with detached mode, we don't need to wait for the tests to complete. Now, we can get inside tmate before the tests start and we can monitor the tests. By default, this mode will wait at the end of the job for a user to connect and then to terminate the tmate session. If no user has connected within 10 minutes after the post-job step started, it will terminate the tmate session and quit gracefully. Signed-off-by: subhamkrai <srai@redhat.com>
24 lines
789 B
YAML
24 lines
789 B
YAML
name: "Tmate debugging tests"
|
|
description: "Setup tmate session if the test fails"
|
|
inputs:
|
|
use-tmate:
|
|
description: "boolean for enabling TMATE"
|
|
required: true
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: consider debugging
|
|
shell: bash --noprofile --norc -eo pipefail -x {0}
|
|
run: |
|
|
# Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run
|
|
if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ inputs.use-tmate }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then
|
|
echo USE_TMATE=1 >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: set up tmate session for debugging
|
|
if: env.USE_TMATE
|
|
uses: mxschmitt/action-tmate@v3
|
|
with:
|
|
limit-access-to-actor: false
|
|
detached: true
|