88 runs-on : ubuntu-latest
99 timeout-minutes : 20
1010 steps :
11- - uses : actions/checkout@master
11+ - uses : actions/checkout@v3
1212
13- - name : Setup Node.js 16.x
14- uses : actions/setup-node@master
13+ - uses : supabase/setup-cli@v1
1514 with :
16- node-version : 16.x
15+ version : latest
16+
17+ - name : Setup Node.js 18.x
18+ uses : actions/setup-node@v3
19+ with :
20+ node-version : 18.x
21+
22+ # from https://github.com/supabase/supabase-action-example/
23+ - run : supabase start -x studio,imgproxy,storage,edge-runtime,vector,realtime,storage-api
24+ working-directory : packages/server
25+ env :
26+ TYPECELL_GITHUB_OAUTH_SECRET : ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
27+ TYPECELL_GOOGLE_OAUTH_SECRET : ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}
28+ - run : supabase db lint
29+ working-directory : packages/server
30+ env :
31+ TYPECELL_GITHUB_OAUTH_SECRET : ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
32+ TYPECELL_GOOGLE_OAUTH_SECRET : ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}
33+ - run : supabase test db
34+ working-directory : packages/server
35+ env :
36+ TYPECELL_GITHUB_OAUTH_SECRET : ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
37+ TYPECELL_GOOGLE_OAUTH_SECRET : ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}
38+
39+ - name : Verify generated supabase types are checked in
40+ working-directory : packages/server
41+ run : |
42+ supabase gen types typescript --local --schema public > ../shared/src/schema.ts
43+ if ! git diff --ignore-space-at-eol --exit-code --quiet ../shared/src/schema.ts; then
44+ echo "Detected uncommitted changes after build. See status below:"
45+ git diff
46+ exit 1
47+ fi
48+ env :
49+ TYPECELL_GITHUB_OAUTH_SECRET : ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
50+ TYPECELL_GOOGLE_OAUTH_SECRET : ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}
1751
1852 # doesn't seem to cause significant speed up, probably because it still needs to install deps
1953 - name : cache playwright
2054 id : playwright-cache
21- uses : actions/cache@v2
55+ uses : actions/cache@v3
2256 with :
2357 path : ~/.cache/ms-playwright
2458 key : pw3-${{ runner.os }}-${{ hashFiles('./package-lock.json') }}
3367 # key: lerna-${{ runner.os }}-${{ hashFiles('./package-lock.json') }}
3468
3569 - name : Cache node modules
36- uses : actions/cache@v2
70+ uses : actions/cache@v3
3771 env :
3872 cache-name : cache-node-modules
3973 with :
@@ -45,84 +79,82 @@ jobs:
4579 ${{ runner.os }}-build-
4680 ${{ runner.os }}-
4781
48- - name : Set correct access for docker containers (server/test/data)
49- run : chmod -R a+rw test-util/server/data
82+ # - name: Set correct access for docker containers (server/test/data)
83+ # run: chmod -R a+rw test-util/server/data
5084
51- - name : Build the docker-compose stack
52- run : docker-compose -f test-util/server/docker-compose.yml up -d
85+ # - name: Build the docker-compose stack
86+ # run: docker-compose -f test-util/server/docker-compose.yml up -d
5387
54- - name : Check running containers
55- run : docker ps -a
88+ # - name: Check running containers
89+ # run: docker ps -a
5690
57- - name : Check docker logs
58- run : docker logs synapse
91+ # - name: Check docker logs
92+ # run: docker logs synapse
5993
6094 - name : NPM CI
6195 run : npm ci
6296
6397 # - name: Bootstrap packages
6498 # run: npm run bootstrap
6599
66- - name : Wait for Matrix
67- run : npx wait-on http://localhost:8888/_matrix/static/
100+ # - name: Wait for Matrix
101+ # run: npx wait-on http://localhost:8888/_matrix/static/
68102
69103 - name : Build packages
70104 run : npm run build
71105 env :
72106 CI : true
73107
74- - name : Install Playwright
75- run : npx playwright install --with-deps
76- # if: steps.playwright-cache.outputs.cache-hit != 'true'
77- # env:
78- # PLAYWRIGHT_BROWSERS_PATH: 0 # https://github.com/microsoft/playwright/blob/main/docs/src/ci.md#caching-browsers
108+ - name : Build packages (vite react)
109+ run : npm run build:react
110+ env :
111+ CI : true
112+ MODE : development
79113
80114 - name : Lint
81115 run : npm run lint
82116 env :
83117 CI : true
84118
85- # Option A: don't build in CI, but test against dev server
86- # (with Vite, building in CI is now fast enough so we can go for option B)
119+ - name : Start HocusPocus server
120+ run : RUNNER_TRACKING_ID="" && npm run start:server &
121+ env :
122+ CI : true
87123
88- # - name: Run dev server
89- # # Wait on config file needed for vite dev server: https://github.com/jeffbski/wait-on/issues/78
90- # run: npm run start:local & npx wait-on http://localhost:5173 -c ./packages/editor/wait-on.conf.json
91- # env:
92- # CI: true
124+ - name : Run Tests
125+ run : npm run test
126+ env :
127+ CI : true
93128
94- # - name: Run Playwright tests (against dev server)
95- # run: npm run playwright:dev
129+ - name : Install Playwright
130+ run : npx playwright install --with-deps
131+ # if: steps.playwright-cache.outputs.cache-hit != 'true'
132+ # env:
133+ # PLAYWRIGHT_BROWSERS_PATH: 0 # https://github.com/microsoft/playwright/blob/main/docs/src/ci.md#caching-browsers
96134
97- # Option B: actually build and run react code and run tests against that
98- - name : Build and run preview server
135+ # Actually build and run react code and run playwright tests against that
136+ - name : Build and run preview
99137 # Wait on config file needed for vite dev server: https://github.com/jeffbski/wait-on/issues/78
100138 run : npm run start:preview & npx wait-on http://localhost:4173 -c ./packages/editor/wait-on.conf.json
101139 env :
102140 CI : true
141+ MODE : development
103142
104- - name : Run Playwright tests (against preview server )
143+ - name : Run Playwright tests (against preview)
105144 run : npm run playwright:preview
106145
107- - uses : actions/upload-artifact@v2
146+ - uses : actions/upload-artifact@v3
108147 if : always()
109148 with :
110149 name : playwright-report-editor
111150 path : packages/editor/playwright-report/
112151 retention-days : 30
113152
114- - uses : actions/upload-artifact@v2
115- if : always()
153+ # Upload webpack-stats.json to use on relative-ci.yaml workflow
154+ - name : Upload webpack stats artifact
155+ uses : relative-ci/agent-upload-artifact-action@v1
116156 with :
117- name : playwright-report-engine
118- path : packages/engine/playwright-report/
119- retention-days : 30
120-
121- - name : Run Tests
122- run : npm run test
123- env :
124- CI : true
125-
157+ webpackStatsFile : ./packages/editor/dist/webpack-stats.json
126158 # - name: Upload to coveralls
127159 # uses: coverallsapp/github-action@master
128160 # with:
0 commit comments