Skip to content

Commit

Permalink
fix action template
Browse files Browse the repository at this point in the history
  • Loading branch information
ShockedPlot7560 committed Dec 16, 2023
1 parent 7c9f652 commit d859a0a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 3 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ inputs:
required: false
default: '.env'
timeout:
description: 'Timeout for tests'
description: 'Timeout for tests (in seconds)'
required: false
default: '10'
default: '60'

outputs:
failed-tests:
Expand All @@ -36,9 +36,8 @@ runs:

- name: 'Run tests'
shell: bash
timeout-minutes: ${{ inputs.timeout }}
id: "run"
run: "${{github.action_path}}/run.sh ${{ steps.prepare.outputs.pocketmine_name }}"
run: "${{github.action_path}}/run.sh ${{ steps.prepare.outputs.pocketmine_name }} ${{ inputs.timeout }}"

- name: 'Collect results'
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

POCKETMINE_NAME=$1
TIMEOUT=$2

./timeout.sh $POCKETMINE_NAME $TIMEOUT &

docker start -ia $POCKETMINE_NAME
9 changes: 9 additions & 0 deletions timeout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
POCKETMINE_NAME=$1
TIMEOUT_TIME=$2

while true
do
sleep $TIMEOUT_TIME
echo "Timeout reached, killing server"
docker kill $POCKETMINE_NAME
done

0 comments on commit d859a0a

Please sign in to comment.