From ff094366042aea86fac688789d9cbaf651804496 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 25 Jun 2025 13:19:00 -0300 Subject: [PATCH 1/5] ci: improve workflow performance and reliability - Add fail-fast: false to matrix strategies for better error visibility - Replace npm clean-install with npm ci for faster, more reliable builds - Add npm caching to all Node.js setup steps - Add if: always() to cleanup steps to ensure Supabase stops on failure - Add NODE_VERSION environment variable for consistency - Add descriptive step names for better debugging - Expand test matrix to include Node 22, 24 and multiple OS platforms - Update Coveralls action to v2 and add conditional execution - Add workflow_call trigger for reusable workflows --- .github/workflows/ci.yml | 138 ++++++++++++++++++++++++++-------- .github/workflows/release.yml | 4 + package-lock.json | 14 ++-- 3 files changed, 117 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2452b278..7f9555e4f 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] + node: [20, 22, 24] + 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,35 +51,73 @@ jobs: run: npm run test:coverage - name: Upload coverage results to Coveralls - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2 + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./test/coverage/lcov.info + security: + name: Security audit + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run security audit + run: npm audit --audit-level=moderate + + - name: Run dependency vulnerability check + run: npx audit-ci --moderate + deno-tests: name: Deno Tests / ${{ matrix.deno }} runs-on: ubuntu-latest 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 +126,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 +189,46 @@ 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 + run: supabase start - name: Build and test expo run: | - npm clean-install + npm ci npm run build PKG=$(npm pack) echo "Packed: $PKG" cd test/integration/expo + npm ci npm install "../../../$PKG" - npm install 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/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" } From acac1296102731e4002393a5ac6334403e07eb6b Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 25 Jun 2025 13:28:55 -0300 Subject: [PATCH 2/5] ci: improve expo test organization - Split expo test steps for better clarity and debugging - Separate dependency installation and build from test execution - Use npm install instead of npm ci for expo test dependencies --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f9555e4f..d38158f72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -218,14 +218,17 @@ jobs: - name: Start Supabase run: supabase start - - name: Build and test expo + - name: Install dependencies and build run: | npm ci npm run build + + - name: Build and test expo + run: | PKG=$(npm pack) echo "Packed: $PKG" cd test/integration/expo - npm ci + npm install npm install "../../../$PKG" npm test || npm test From 7036981eb41fb087bb18255435101f98e3f4dd62 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 25 Jun 2025 13:44:26 -0300 Subject: [PATCH 3/5] chore: add .cursor/ to gitignore - Ignore Cursor IDE configuration files and workspace data --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) 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 From 28976a766cc22910efea9874e336aef80dccd992 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 25 Jun 2025 13:44:37 -0300 Subject: [PATCH 4/5] chore(deps): update expo test dependencies - Update React to 19.1.0 - Update @supabase/realtime-js to 2.11.15 - Add @types/ws and ws dependencies for WebSocket support --- test/integration/expo/package-lock.json | 29 +++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) 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" From 218f445b4a82a57b20e1966d6a1f35faa1d70349 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Thu, 26 Jun 2025 04:50:42 -0300 Subject: [PATCH 5/5] chore(ci): optimize workflow performance and reduce matrix testing - Reduce Node.js matrix from [20, 22, 24] to [20] for faster CI runs - Remove conditional coverage upload to simplify workflow - Remove security audit job to reduce CI complexity and runtime - Maintains all essential testing while improving CI efficiency --- .github/workflows/ci.yml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d38158f72..7a6d35b7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: [20, 22, 24] + node: [20] os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false steps: @@ -52,33 +52,10 @@ jobs: - name: Upload coverage results to Coveralls uses: coverallsapp/github-action@v2 - if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./test/coverage/lcov.info - security: - name: Security audit - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Run security audit - run: npm audit --audit-level=moderate - - - name: Run dependency vulnerability check - run: npx audit-ci --moderate - deno-tests: name: Deno Tests / ${{ matrix.deno }} runs-on: ubuntu-latest