feat(storage): storage vectors and analytics in storage-js #154
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Core packages tests | |
on: | |
pull_request: | |
paths: | |
- 'packages/core/auth-js/**' | |
- 'packages/core/functions-js/**' | |
- 'packages/core/postgrest-js/**' | |
- 'packages/core/realtime-js/**' | |
- 'packages/core/storage-js/**' | |
- 'package.json' | |
- 'package-lock.json' | |
- 'nx.json' | |
- 'tsconfig.base.json' | |
- '.github/workflows/ci-core.yml' | |
- '!packages/**/*.md' | |
- '!packages/**/docs/**' | |
- '!packages/**/.prettierrc' | |
- '!packages/**/*ignore' | |
workflow_call: | |
permissions: | |
actions: read | |
contents: read | |
jobs: | |
setup-build-test-node-20: | |
name: Run tests for Node.js 20 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
filter: tree:0 | |
fetch-depth: 0 | |
# Cache node_modules | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
- uses: nrwl/nx-set-shas@v4 | |
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud | |
# - run: npx nx-cloud record -- echo Hello World | |
# When you enable task distribution, run the e2e-ci task instead of e2e | |
- name: Check common types are in sync | |
run: npm run codegen:check | |
- name: Build affected packages | |
run: npx nx affected --target=build | |
- name: Generate docs json for affected packages | |
run: npx nx affected --target=docs:json | |
- name: Run test:ci for affected packages | |
run: npx nx affected --target=test:ci | |
timeout-minutes: 15 | |
- name: Upload coverage for functions-js (if affected) | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./packages/core/functions-js/coverage/lcov.info | |
parallel: true | |
flag-name: functions-js | |
fail-on-error: false | |
continue-on-error: true | |
- name: Upload coverage for realtime-js (if affected) | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./packages/core/realtime-js/coverage/lcov.info | |
parallel: true | |
flag-name: realtime-js | |
fail-on-error: false | |
continue-on-error: true | |
- name: Run auth-js tests (if affected) | |
run: npx nx affected --target=test:auth | |
- name: Upload coverage for auth-js (if affected) | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./packages/core/auth-js/test/coverage/lcov.info | |
parallel: true | |
flag-name: auth-js | |
fail-on-error: false | |
continue-on-error: true | |
- name: Run storage-js tests (if affected) | |
run: npx nx affected --target=test:storage | |
- name: Upload coverage for storage-js (if affected) | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./packages/core/storage-js/coverage/lcov.info | |
parallel: true | |
flag-name: storage-js | |
fail-on-error: false | |
continue-on-error: true | |
# Separate job for postgrest-js tests (Docker-based, retriable) | |
test-postgrest-js: | |
name: Test postgrest-js | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
filter: tree:0 | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
- uses: nrwl/nx-set-shas@v4 | |
- name: Run postgrest-js integration tests (if affected) | |
run: npx nx affected --target=test:ci:postgrest | |
timeout-minutes: 10 | |
- name: Run postgrest-js type tests (if affected) | |
run: npx nx affected --target=test:types:ci | |
timeout-minutes: 15 | |
- name: Upload coverage for postgrest-js (if affected) | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./packages/core/postgrest-js/coverage/lcov.info | |
parallel: true | |
flag-name: postgrest-js | |
fail-on-error: false | |
continue-on-error: true | |
# Separate job for slow type generation check (runs in parallel) | |
check-postgrest-generated-types: | |
name: Check Postgrest Generated Types | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
filter: tree:0 | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
- name: Check if database schema changed | |
id: check_changes | |
run: | | |
git fetch origin ${{ github.base_ref }} | |
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q "packages/core/postgrest-js/test/db/"; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "changed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Verify generated types are in sync | |
if: steps.check_changes.outputs.changed == 'true' | |
run: npm run codegen:check:postgrest | |
timeout-minutes: 5 | |
- name: Skip check | |
if: steps.check_changes.outputs.changed != 'true' | |
run: echo "⏭️ Skipping - no database schema changes detected" | |
# SUMMARY JOB | |
all-core-tests-pass: | |
name: All Core Package Tests Pass | |
runs-on: ubuntu-latest | |
needs: [setup-build-test-node-20, test-postgrest-js, check-postgrest-generated-types] | |
steps: | |
- name: Summary | |
run: echo "✅ All core package tests passed successfully!" | |
coveralls-finish: | |
name: Coveralls Finished | |
runs-on: ubuntu-latest | |
needs: [setup-build-test-node-20, test-postgrest-js] | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true | |
fail-on-error: false | |
continue-on-error: true |