mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
<!--
Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md
-->
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Add Convex integration with new auth helpers, update access token
handling, and include documentation, examples, and tests for the new
features.
>
> - **Features**:
> - Add Convex integration with new auth helpers for Convex clients and
HTTP in `client-app-impl.ts` and `server-app-impl.ts`.
> - Support for Convex context in user APIs and partial user retrieval.
> - Access tokens now include `is_anonymous` for better anonymous
handling in `tokens.tsx`.
> - **Documentation**:
> - Add Convex integration guide in `docs/templates/others/convex.mdx`.
> - Update docs navigation in `docs/docs-platform.yml` and
`docs/templates/meta.json`.
> - **Examples**:
> - Add Convex + Next.js example app in `examples/convex` with auth
wiring, functions, schema, and UI.
> - **Tests**:
> - Add E2E tests for Convex auth flows in `convex.test.ts`.
> - Update JWT payload checks in `backend-helpers.ts` and
`anonymous-comprehensive.test.ts`.
> - **Chores**:
> - Add Convex dependencies in `package.json` files.
> - Update CI steps for example environments in `e2e-api-tests.yaml` and
`e2e-source-of-truth-api-tests.yaml`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for aa0983a8b7. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
----
<!-- ELLIPSIS_HIDDEN -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Convex integration: auth helpers for Convex clients/HTTP, Convex-aware
user APIs, and partial-user retrieval (token/convex).
- Access tokens now surface is_anonymous for clearer anonymous handling.
- **Documentation**
- Added Convex integration guide and nav entries.
- **Examples**
- New Convex + Next.js example app with auth wiring, backend functions,
schema, and UI.
- **Tests**
- Added E2E tests covering Convex auth flows and JWT payload checks.
- **Chores**
- Added Convex deps, CI env steps, and workspace/test config updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
153 lines
5.1 KiB
YAML
153 lines
5.1 KiB
YAML
name: Runs E2E API Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubicloud-standard-8
|
|
env:
|
|
NODE_ENV: test
|
|
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
|
|
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe"
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [22.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
with:
|
|
version: 9.1.2
|
|
|
|
# Even just starting the Docker Compose as a daemon is slow because we have to download and build the images
|
|
# so, we run it in the background
|
|
- name: Start Docker Compose in background
|
|
uses: JarvusInnovations/background-action@v1.0.7
|
|
with:
|
|
run: docker compose -f docker/dependencies/docker.compose.yaml up -d &
|
|
# we don't need to wait on anything, just need to start the daemon
|
|
wait-on: /dev/null
|
|
tail: true
|
|
wait-for: 3s
|
|
log-output-if: true
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Create .env.test.local file for apps/backend
|
|
run: cp apps/backend/.env.development apps/backend/.env.test.local
|
|
|
|
- name: Create .env.test.local file for apps/dashboard
|
|
run: cp apps/dashboard/.env.development apps/dashboard/.env.test.local
|
|
|
|
- name: Create .env.test.local file for apps/e2e
|
|
run: cp apps/e2e/.env.development apps/e2e/.env.test.local
|
|
|
|
- name: Create .env.test.local file for docs
|
|
run: cp docs/.env.development docs/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/cjs-test
|
|
run: cp examples/cjs-test/.env.development examples/cjs-test/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/demo
|
|
run: cp examples/demo/.env.development examples/demo/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/docs-examples
|
|
run: cp examples/docs-examples/.env.development examples/docs-examples/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/e-commerce
|
|
run: cp examples/e-commerce/.env.development examples/e-commerce/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/middleware
|
|
run: cp examples/middleware/.env.development examples/middleware/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/partial-prerendering
|
|
run: cp examples/partial-prerendering/.env.development examples/partial-prerendering/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/supabase
|
|
run: cp examples/supabase/.env.development examples/supabase/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/convex
|
|
run: cp examples/convex/.env.development examples/convex/.env.test.local
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Wait on Postgres
|
|
run: pnpm run wait-until-postgres-is-ready:pg_isready
|
|
|
|
- name: Wait on Inbucket
|
|
run: npx wait-on tcp:localhost:2500
|
|
|
|
- name: Wait on Svix
|
|
run: npx wait-on tcp:localhost:8113
|
|
|
|
- name: Initialize database
|
|
run: pnpm run db:init
|
|
|
|
- name: Start stack-backend in background
|
|
uses: JarvusInnovations/background-action@v1.0.7
|
|
with:
|
|
run: pnpm run start:backend --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start stack-dashboard in background
|
|
uses: JarvusInnovations/background-action@v1.0.7
|
|
with:
|
|
run: pnpm run start:dashboard --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start mock-oauth-server in background
|
|
uses: JarvusInnovations/background-action@v1.0.7
|
|
with:
|
|
run: pnpm run start:mock-oauth-server --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
|
|
- name: Wait 10 seconds
|
|
run: sleep 10
|
|
|
|
- name: Run tests
|
|
run: pnpm test
|
|
|
|
- name: Run tests again, to make sure they are stable (attempt 1)
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
|
run: pnpm test
|
|
|
|
- name: Run tests again, to make sure they are stable (attempt 2)
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
|
run: pnpm test
|
|
|
|
- name: Verify data integrity
|
|
run: pnpm run verify-data-integrity
|
|
|
|
- name: Print Docker Compose logs
|
|
if: always()
|
|
run: docker compose -f docker/dependencies/docker.compose.yaml logs
|