-
-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (39 loc) · 1.68 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
testCodebase:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.14.2
uses: actions/setup-node@v3
with:
node-version: 16.14.2
- run: npm ci
- run: npm run lint
- run: npm run typecheck
testCli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.14.2
uses: actions/setup-node@v3
with:
node-version: 16.14.2
- run: npm ci
- run: npm run dev -- -- --ci
# This is what the user would do, minus actually starting the application
- run: cd my-sidebase-app && npx prisma db push
# code should be 100% correct at the start
- run: cd my-sidebase-app && npm run lint
- run: cd my-sidebase-app && npm exec nuxi prepare && npm run typecheck
# start dev-app, all of the following adapted from https://stackoverflow.com/a/60996259
- 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\" )"
# start prod-app
- run: "export AUTH_ORIGIN=http://localhost:3000 && export AUTH_SECRET=test123 && 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\" )"
# start dev-app and curl from it
- run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 20 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"