Skip to content

Commit

Permalink
ci: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
UlisesGascon committed Apr 18, 2024
1 parent 2af6b97 commit beae7e7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,22 @@ jobs:
workflow_url=$(echo "$response" | jq -r '.workflow_runs[0].url')
status=""
while [[ "$status" != "completed" ]]; do
start_time=$(date +%s)
timeout=$((10 * 60)) # timeout after 10 minutes
while [[ "$status" != "completed" && $(( $(date +%s) - start_time )) -lt $timeout ]]; do
echo "checking..."
sleep 10
response=$(curl -H "Authorization: token $TOKEN" $workflow_url)
status=$(echo "$response" | jq -r .status)
echo "current status: $status"
done
conclusion=$(echo "$response" | jq -r .conclusion)
echo "The conclusion of the workflow run is: $conclusion"
if [[ "$conclusion" != "success" ]]; then
echo "Workflow failed"
if [[ $(( $(date +%s) - start_time )) -ge $timeout ]]; then
echo "Workflow did not complete within the expected time"
fi
if [[ "$status" != "completed" ]]; then
echo "Workflow failed. Current status: $status"
exit 1
fi

0 comments on commit beae7e7

Please sign in to comment.