Skip to content

Commit 9f38ded

Browse files
committed
chore: harden fly deploy workflow
1 parent 006c064 commit 9f38ded

1 file changed

Lines changed: 39 additions & 11 deletions

File tree

.github/workflows/validate.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
setup:
1616
name: 🔧 Setup
17-
timeout-minutes: 10
17+
timeout-minutes: 15
1818
strategy:
1919
matrix:
2020
os: [ubuntu-latest, windows-latest, macos-latest]
@@ -25,29 +25,51 @@ jobs:
2525
with:
2626
node-version: 26
2727

28+
# SKIP_PLAYGROUND keeps typecheck/lint meaningful: problem playground apps
29+
# intentionally fail solution tests/types, which would create false CI red.
2830
- name: ▶️ Add repo
29-
run: |
30-
npx --yes epicshop@latest add ${{ github.event.repository.name }}#${{ github.head_ref || github.ref_name }} ./workshop
3131
env:
3232
# Kept getting npm ECOMPROMISED errors on windows. This fixed it.
3333
npm_config_cache: ${{ runner.temp }}/npm-cache
3434
SKIP_PLAYWRIGHT: true
35+
SKIP_PLAYGROUND: true
36+
run: |
37+
set -euo pipefail
38+
attempt=1
39+
max_attempts=3
40+
delay_seconds=20
41+
while true; do
42+
echo "::group::epicshop add attempt ${attempt}/${max_attempts}"
43+
set +e
44+
npx --yes epicshop@latest add ${{ github.event.repository.name }}#${{ github.head_ref || github.ref_name }} ./workshop
45+
status=$?
46+
set -e
47+
echo "::endgroup::"
48+
if [ "$status" -eq 0 ]; then
49+
exit 0
50+
fi
51+
if [ "$attempt" -ge "$max_attempts" ]; then
52+
echo "epicshop add failed after ${max_attempts} attempts" >&2
53+
exit "$status"
54+
fi
55+
echo "epicshop add failed (exit ${status}); retrying in ${delay_seconds}s..."
56+
sleep "$delay_seconds"
57+
delay_seconds=$((delay_seconds * 2))
58+
attempt=$((attempt + 1))
59+
done
3560
3661
- name: ʦ TypeScript
3762
run: npm run typecheck
3863
working-directory: ./workshop
3964

40-
- name: Oxlint
65+
- name: Lint
4166
run: npm run lint
4267
working-directory: ./workshop
4368

4469
tests:
4570
name: 🧪 Test
46-
timeout-minutes: 10
71+
timeout-minutes: 15
4772
runs-on: ubuntu-latest
48-
# Use continue-on-error to ensure this job doesn't fail the workflow
49-
continue-on-error: true
50-
5173
steps:
5274
- name: ⬇️ Checkout repo
5375
uses: actions/checkout@v4
@@ -60,9 +82,15 @@ jobs:
6082
- name: 📦 Install dependencies
6183
run: npm ci
6284

63-
- name: 🧪 Run tests
64-
id: run_tests
65-
run: node ./epicshop/test.ts ..s
85+
# Workshops ship epicshop/test.js (not .ts). `..s` runs solution apps only.
86+
- name: 🧪 Run solution tests
87+
run: |
88+
set -euo pipefail
89+
if [ -f ./epicshop/test.js ]; then
90+
node ./epicshop/test.js ..s
91+
else
92+
echo "No epicshop/test.js in this workshop; skipping solution-app test runner."
93+
fi
6694
6795
deploy:
6896
name: 🚀 Deploy

0 commit comments

Comments
 (0)