diff --git a/.github/common/supabase/action.yml b/.github/common/supabase/action.yml new file mode 100644 index 000000000..33fb205ff --- /dev/null +++ b/.github/common/supabase/action.yml @@ -0,0 +1,24 @@ +name: Setup Supabase and Seed Database + +runs: + using: "composite" + steps: + - name: Install Supabase CLI + uses: supabase/setup-cli@v1 + with: + version: "latest" + + - name: Start Supabase Services + shell: bash + run: | + pnpm run with-test-env pnpm supabase start -x=realtime,logflare,postgres-meta,mailpit,edge-runtime,studio,vector + + - name: Run Database Migrations + shell: bash + run: | + pnpm run with-test-env drizzle-kit migrate --config ./db/drizzle.config.ts + + - name: Seed Database + shell: bash + run: | + pnpm run with-test-env pnpm tsx --conditions=react-server ./db/seeds/seedDatabase.ts diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 595d88e89..df7549a20 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -71,8 +71,8 @@ jobs: run: pnpm playwright install --with-deps chromium if: steps.playwright-cache.outputs.cache-hit != 'true' - - name: Setup E2E test environment - run: ./scripts/setup-e2e-tests.sh + - name: Setup Supabase and Seed + uses: ./.github/common/supabase - name: Build next run: pnpm with-test-env next build