diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2452b278..7a6d35b7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,21 +17,32 @@ on: - '**/*.md' - '.prettierrc' - '**/*ignore' + workflow_call: + +env: + NODE_VERSION: '20' jobs: test: - name: Unit + Type Check / Node.js ${{ matrix.node }} - runs-on: ubuntu-latest + name: Unit + Type Check / Node.js ${{ matrix.node }} / OS ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: matrix: node: [20] + os: [ubuntu-latest, macos-latest, windows-latest] + fail-fast: false steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} + cache: 'npm' - - run: npm clean-install + - name: Install dependencies + run: npm ci - name: Type Check run: npm run test:types @@ -40,7 +51,7 @@ jobs: run: npm run test:coverage - name: Upload coverage results to Coveralls - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./test/coverage/lcov.info @@ -51,24 +62,39 @@ jobs: strategy: matrix: deno: ['1.x', '2.x'] + fail-fast: false steps: - - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v2 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Deno + uses: denoland/setup-deno@v2 with: deno-version: ${{ matrix.deno }} - - uses: supabase/setup-cli@v1 + + - name: Setup Supabase CLI + uses: supabase/setup-cli@v1 with: version: latest + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + - name: Start Supabase run: supabase start - - name: Run Deno Tests + - name: Install dependencies and build run: | - npm clean-install + npm ci npm run build + + - name: Run Deno Tests + run: | cd test/deno - npm install + npm ci npm test || npm test # - name: Run integration and browser tests on Deno 2.x only @@ -77,41 +103,57 @@ jobs: # npm run test:integration:browser - name: Stop Supabase + if: always() run: supabase stop node-integration: name: Node Integration runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: 20 - - uses: supabase/setup-cli@v1 + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Setup Supabase CLI + uses: supabase/setup-cli@v1 with: version: latest - name: Start Supabase run: supabase start - - name: Run integration tests + - name: Install dependencies and build run: | - npm clean-install + npm ci npm run build - npm run test:integration || npm run test:integration + + - name: Run integration tests + run: npm run test:integration || npm run test:integration - name: Stop Supabase + if: always() run: supabase stop next-integration: name: Next.js Integration runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: 20 - - uses: supabase/setup-cli@v1 + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Setup Supabase CLI + uses: supabase/setup-cli@v1 with: version: latest @@ -124,39 +166,49 @@ jobs: - name: Run integration tests run: | cd test/integration/next - npm install + npm ci npx playwright install npm run test - name: Stop Supabase + if: always() run: supabase stop expo-tests: name: Expo Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: 20 - - uses: supabase/setup-cli@v1 + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Setup Supabase CLI + uses: supabase/setup-cli@v1 with: version: latest - name: Start Supabase + run: supabase start + + - name: Install dependencies and build run: | - supabase start + npm ci + npm run build - name: Build and test expo run: | - npm clean-install - npm run build PKG=$(npm pack) echo "Packed: $PKG" cd test/integration/expo - npm install "../../../$PKG" npm install + npm install "../../../$PKG" npm test || npm test - name: Stop Supabase + if: always() run: supabase stop diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbc2a31d2..92377af96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,12 @@ on: workflow_dispatch: jobs: + test: + uses: ./.github/workflows/ci.yml + release: name: Release / Node ${{ matrix.node }} + needs: test strategy: matrix: node: ['20'] diff --git a/.gitignore b/.gitignore index ea94053f6..309c13bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,5 @@ dist .tern-port docs/v2 + +.cursor/ \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7530d4d82..f72bf07cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2177,10 +2177,11 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8168,10 +8169,11 @@ } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } diff --git a/test/integration/expo/package-lock.json b/test/integration/expo/package-lock.json index f700cb574..e73ac79c2 100644 --- a/test/integration/expo/package-lock.json +++ b/test/integration/expo/package-lock.json @@ -3464,14 +3464,16 @@ } }, "node_modules/@supabase/realtime-js": { - "version": "2.11.13", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.13.tgz", - "integrity": "sha512-X2Gs+f0qjLr/60UTCidxRj+FCI/ABNar93aeMQj+v/7sm4RYOWlKNw46xmwWXL8zAL30wsHG2jD7ZvCH6zDv1A==", + "version": "2.11.15", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.15.tgz", + "integrity": "sha512-HQKRnwAqdVqJW/P9TjKVK+/ETpW4yQ8tyDPPtRMKOH4Uh3vQD74vmj353CYs8+YwVBKubeUOOEpI9CT8mT4obw==", "license": "MIT", "dependencies": { "@supabase/node-fetch": "^2.6.13", "@types/phoenix": "^1.6.6", - "isows": "^1.0.7" + "@types/ws": "^8.18.1", + "isows": "^1.0.7", + "ws": "^8.18.2" } }, "node_modules/@supabase/storage-js": { @@ -3486,14 +3488,14 @@ "node_modules/@supabase/supabase-js": { "version": "0.0.0-automated", "resolved": "file:../../../supabase-supabase-js-0.0.0-automated.tgz", - "integrity": "sha512-8zgVCClwNLxJ8YUSNVCgCL/EQ+sGoDroBl6D84EObVi615jU5pQ0o3DiewD1AoobdsVzwUaPeqvJSeAbsc9IOQ==", + "integrity": "sha512-UDZtvIlgHb6O4L7a2xtXGOnV8n0MVE5Q0qhTO5q+ji6LAYHgIDj8z0ZBy+CwqtrP5bGbct/sdiPglS8WAbCWMg==", "license": "MIT", "dependencies": { "@supabase/auth-js": "2.70.0", "@supabase/functions-js": "2.4.4", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.19.4", - "@supabase/realtime-js": "2.11.13", + "@supabase/realtime-js": "2.11.15", "@supabase/storage-js": "2.7.1" } }, @@ -3730,6 +3732,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -12285,9 +12296,9 @@ } }, "node_modules/react": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", - "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "license": "MIT", "engines": { "node": ">=0.10.0"