Skip to content

Commit 3ba13ab

Browse files
georgRusanovgeorgiy.rusanov
andauthored
Expo ci fix (#1465)
* try to fix ci * trying to fix expo job * buils and test in one step * fix * another try * check realtime * another try * debug * debug * debug * debug * more logs * looking the problem with realtime * more logs * more logs * debug * wait for Tenant realtime-dev * use real ws in expo * real ws * deleted all logging * trying universal * deleted universal --------- Co-authored-by: georgiy.rusanov <[email protected]>
1 parent d8e69f1 commit 3ba13ab

File tree

4 files changed

+87
-55
lines changed

4 files changed

+87
-55
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,91 +20,117 @@ on:
2020

2121
jobs:
2222
test:
23-
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
23+
name: Unit + Type Check / Node.js ${{ matrix.node }}
24+
runs-on: ubuntu-latest
2425
strategy:
2526
matrix:
26-
os: [ubuntu-latest]
2727
node: ['20']
2828

29-
runs-on: ${{ matrix.os }}
30-
3129
steps:
3230
- uses: actions/checkout@v4
33-
34-
- name: Set up Node
35-
uses: actions/setup-node@v4
31+
- uses: actions/setup-node@v4
3632
with:
3733
node-version: ${{ matrix.node }}
3834

39-
- name: Run tests
40-
run: |
41-
npm clean-install
42-
npm run test:coverage
35+
- run: npm clean-install
36+
37+
- name: Type Check
38+
run: npm run test:types
39+
40+
- name: Run Unit Tests + Coverage
41+
run: npm run test:coverage
4342

4443
- name: Upload coverage results to Coveralls
4544
uses: coverallsapp/github-action@master
4645
with:
4746
github-token: ${{ secrets.GITHUB_TOKEN }}
4847
path-to-lcov: ./test/coverage/lcov.info
4948

50-
integration:
51-
name: Integration / OS ${{ matrix.os }} / Node ${{ matrix.node }} / Deno ${{ matrix.deno }}
49+
deno-tests:
50+
name: Deno Tests / ${{ matrix.deno }}
51+
runs-on: ubuntu-latest
5252
strategy:
5353
matrix:
54-
os: [ubuntu-latest]
55-
node: ['20']
5654
deno: ['1.x', '2.x']
57-
58-
runs-on: ${{ matrix.os }}
59-
6055
steps:
6156
- uses: actions/checkout@v4
62-
63-
- name: Set up Node
64-
uses: actions/setup-node@v4
65-
with:
66-
node-version: ${{ matrix.node }}
67-
6857
- uses: denoland/setup-deno@v2
6958
with:
7059
deno-version: ${{ matrix.deno }}
71-
72-
- name: Setup Supabase
73-
uses: supabase/setup-cli@v1
60+
- uses: supabase/setup-cli@v1
7461
with:
7562
version: latest
7663

7764
- name: Start Supabase
78-
run: |
79-
supabase start
65+
run: supabase start
8066

81-
- name: Build
67+
- name: Run Deno Tests
8268
run: |
8369
npm clean-install
8470
npm run build
85-
npm pack
71+
cd test/deno
72+
npm install
73+
npm test || npm test
8674
87-
- name: Run integration tests
75+
- name: Run integration and browser tests on Deno 2.x only
76+
if: ${{ matrix.deno == '2.x' }}
8877
run: |
8978
npm run test:integration || npm run test:integration
79+
npm run test:integration:browser
80+
81+
- name: Stop Supabase
82+
run: supabase stop
83+
84+
node-integration:
85+
name: Node Integration
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
- uses: actions/setup-node@v4
90+
with:
91+
node-version: 20
92+
- uses: supabase/setup-cli@v1
93+
with:
94+
version: latest
9095

91-
- name: Run browser integration tests
96+
- name: Start Supabase
97+
run: supabase start
98+
99+
- name: Run integration tests
92100
run: |
93-
npm run test:integration:browser
101+
npm clean-install
102+
npm run build
103+
npm run test:integration || npm run test:integration
104+
105+
- name: Stop Supabase
106+
run: supabase stop
107+
108+
expo-tests:
109+
name: Expo Tests
110+
runs-on: ubuntu-latest
111+
steps:
112+
- uses: actions/checkout@v4
113+
- uses: actions/setup-node@v4
114+
with:
115+
node-version: 20
116+
- uses: supabase/setup-cli@v1
117+
with:
118+
version: latest
94119

95-
- name: Run Deno tests
120+
- name: Start Supabase
96121
run: |
97-
cd test/deno
98-
npm test || npm test
122+
supabase start
99123
100-
- name: Run expo compatibility tests
124+
- name: Build and test expo
101125
run: |
126+
npm clean-install
127+
npm run build
128+
PKG=$(npm pack)
129+
echo "Packed: $PKG"
102130
cd examples/expo-app
131+
npm install "../../$PKG"
103132
npm install
104-
# make sure we're using the version that was just packed above
105-
npm update @supabase/supabase-js
106-
npm run test || npm run test
133+
npm test || npm test
107134
108135
- name: Stop Supabase
109-
run: |
110-
supabase stop
136+
run: supabase stop

examples/expo-app/jest.setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global.WebSocket = require('ws')

examples/expo-app/package-lock.json

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/expo-app/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@
4242
},
4343
"devDependencies": {
4444
"@babel/core": "^7.25.2",
45+
"@testing-library/react-native": "^13.2.0",
4546
"@types/jest": "^29.5.14",
4647
"@types/react": "~19.1.0",
4748
"eslint": "^9.25.0",
4849
"eslint-config-expo": "~9.2.0",
4950
"jest": "~29.7.0",
5051
"jest-expo": "~53.0.5",
5152
"typescript": "~5.8.3",
52-
"@testing-library/react-native": "^13.2.0"
53+
"ws": "^8.18.2"
5354
},
5455
"private": true,
5556
"jest": {
56-
"preset": "jest-expo"
57+
"preset": "jest-expo",
58+
"setupFiles": [
59+
"./jest.setup.js"
60+
]
5761
}
5862
}

0 commit comments

Comments
 (0)