Skip to content

Commit cffb695

Browse files
committed
chore: harden fly deploy workflow
1 parent 94f917a commit cffb695

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
- name: ⬣ Lint
7070
run: npm run lint
7171
working-directory: ./workshop
72+
env:
73+
NODE_OPTIONS: --max-old-space-size=8192
7274

7375
tests:
7476
name: 🧪 Test
@@ -81,28 +83,38 @@ jobs:
8183
- name: ⎔ Setup node
8284
uses: actions/setup-node@v4
8385
with:
84-
# The workshop's pinned MSW/Undici stack has an AbortSignal realm
85-
# incompatibility on Node 26. Node 22 is supported by package.json.
86-
node-version: 22
86+
node-version: 26
8787

8888
- name: 📦 Install dependencies
8989
run: npm ci
9090

91-
- name: 🏗 Prepare solution tests
92-
env:
93-
SKIP_PLAYWRIGHT: true
94-
SKIP_PLAYGROUND: true
95-
run: npm run setup:custom
91+
- name: 🎭 Install Playwright browser
92+
if: ${{ hashFiles('epicshop/test.js') != '' }}
93+
run: npx playwright install --with-deps chromium
94+
95+
- name: ◭ Generate Prisma clients
96+
if: ${{ hashFiles('epicshop/test.js') != '' }}
97+
run: |
98+
set -euo pipefail
99+
shopt -s globstar nullglob
100+
schemas=(./exercises/**/*.solution.*/prisma/schema.prisma)
101+
if [ "${#schemas[@]}" -eq 0 ]; then
102+
echo "No solution-app Prisma schemas found; skipping Prisma client generation."
103+
exit 0
104+
fi
105+
for schema in "${schemas[@]}"; do
106+
app_dir="${schema%/prisma/schema.prisma}"
107+
echo "::group::prisma generate in ${app_dir}"
108+
(cd "$app_dir" && npx prisma generate)
109+
echo "::endgroup::"
110+
done
96111
97-
# Exercises 1–3 contain Playwright suites, which cannot be collected by
98-
# their `npm test` Vitest command. Run every test in the completed Vitest
99-
# solution for exercises 4–11; intermediate steps can intentionally
100-
# demonstrate failing tests that later steps fix.
112+
# Workshops ship epicshop/test.js (not .ts). `..s` runs solution apps only.
101113
- name: 🧪 Run solution tests
102114
run: |
103115
set -euo pipefail
104116
if [ -f ./epicshop/test.js ]; then
105-
node ./epicshop/test.js '4.4.s,5.2.s,6.2.s,7.2.s,8.3.s,9.3.s,10.1.s,11.3.s'
117+
node ./epicshop/test.js ..s
106118
else
107119
echo "No epicshop/test.js in this workshop; skipping solution-app test runner."
108120
fi

0 commit comments

Comments
 (0)