Skip to content

Commit 9ab9504

Browse files
authored
feat: more smoke tests - start the application and see if that works without error (#4)
* feat: more smoke tests: just starting * feat: fix smoke tests * feat: switch from prisma layer to "direct" prisma integration * fix: fix yaml by escaping echo quotes * fix: set auth origin for prod smoke tests * fix: correctly export auth origin, correctly set braces
1 parent 018fc2d commit 9ab9504

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ jobs:
3838
# This is what the user would do, minus actually starting the application
3939
- run: cd my-sidebase-app && npx prisma db push && npx prisma generate
4040

41-
# start app and curl from it
42-
- run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 10 && curl --fail localhost:3000)"
41+
# start dev-app, all of the following adapted from https://stackoverflow.com/a/60996259
42+
- run: "cd my-sidebase-app && timeout 30 npm run dev || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
4343

44-
# build app, start it in prod mode and curl from it
45-
- run: "cd my-sidebase-app && npm run build && timeout 30 npm run preview & (sleep 10 && curl --fail localhost:3000)"
44+
# start prod-app
45+
- run: "export AUTH_ORIGIN=http://localhost:3000 && cd my-sidebase-app && npm run build && timeout 30 npm run preview || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
46+
47+
# start dev-app and curl from it
48+
- run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 10 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
49+
50+
# build prod-app, start it in prod mode and curl from it
51+
- run: "export AUTH_ORIGIN=http://localhost:3000 && cd my-sidebase-app && npm run build && timeout 30 npm run preview & (sleep 10 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
4652

4753
publish:
4854
needs: [testCli, testCodebase]

0 commit comments

Comments
 (0)