Skip to content

Commit 4867339

Browse files
committed
chore: harden fly deploy workflow
1 parent 3313c36 commit 4867339

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/validate.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,17 @@ jobs:
6262
attempt=$((attempt + 1))
6363
done
6464
65+
# Some workshops generate React Router route types and Prisma clients for
66+
# their exercise apps here. Generate them before the root project-reference
67+
# typecheck, while allowing older workshops without this script to proceed.
68+
- name: ⚙️ Generate app artifacts
69+
run: npm run generate --if-present
70+
working-directory: ./workshop
71+
72+
# Not every workshop has TypeScript. `--if-present` skips only a missing
73+
# script; npm still returns a failure when an existing typecheck fails.
6574
- name: ʦ TypeScript
66-
run: npm run typecheck
75+
run: npm run typecheck --if-present
6776
working-directory: ./workshop
6877

6978
- name: ⬣ Lint
@@ -97,7 +106,14 @@ jobs:
97106
run: |
98107
set -euo pipefail
99108
shopt -s globstar nullglob
100-
schemas=(./exercises/**/*.solution.*/prisma/schema.prisma)
109+
schemas=()
110+
for schema in ./exercises/**/prisma/schema.prisma; do
111+
app_dir="${schema%/prisma/schema.prisma}"
112+
app_name="${app_dir##*/}"
113+
if [[ "$app_name" =~ ^[0-9]+\.solution(\..+)?$ ]]; then
114+
schemas+=("$schema")
115+
fi
116+
done
101117
if [ "${#schemas[@]}" -eq 0 ]; then
102118
echo "No solution-app Prisma schemas found; skipping Prisma client generation."
103119
exit 0

0 commit comments

Comments
 (0)