Skip to content

Commit 359322a

Browse files
committed
Limit provider workflow lifetime
1 parent f0cb0aa commit 359322a

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/simdeck-provider.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ permissions:
3232
jobs:
3333
provider:
3434
runs-on: macos-latest
35-
timeout-minutes: 360
35+
timeout-minutes: 35
3636
steps:
3737
- name: Check out repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@v6
3939

4040
- name: Download simulator artifact
4141
if: ${{ inputs.artifact_id != '' }}
42-
uses: actions/download-artifact@v4
42+
uses: actions/download-artifact@v8
4343
with:
4444
artifact-ids: ${{ inputs.artifact_id }}
4545
run-id: ${{ inputs.source_run_id || github.run_id }}
@@ -186,8 +186,17 @@ jobs:
186186
187187
register
188188
echo "SimDeck tunnel: $tunnel_url"
189+
deadline=$((SECONDS + 1800))
189190
while true; do
190191
sleep 30
192+
if (( SECONDS >= deadline )); then
193+
curl -fsS \
194+
-H 'content-type: application/json' \
195+
-d "{\"previewId\":\"$PREVIEW_ID\",\"providerToken\":\"$PROVIDER_TOKEN\",\"providerRunId\":\"$GITHUB_RUN_ID\",\"providerRunUrl\":\"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"status\":\"expired\"}" \
196+
"$SIMDECK_CLOUD_URL/api/actions/providers/register" || true
197+
echo "SimDeck provider hard timeout reached"
198+
exit 0
199+
fi
191200
if ! kill -0 "$simdeck_pid" 2>/dev/null; then
192201
echo "simdeck exited"
193202
cat simdeck.log || true

0 commit comments

Comments
 (0)