feat(server + client): add support for server-sent events (SSE) #19610
Workflow file for this run
This file contains 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: main | |
on: | |
pull_request: | |
types: [synchronize, opened, reopened] | |
push: | |
branches: [main, next, canary] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
# only run on PRs | |
if: github.event_name == 'pull_request' | |
timeout-minutes: 10 | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/setup | |
- run: pnpm turbo --filter "@trpc/*" build | |
test: | |
timeout-minutes: 10 | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/setup | |
- run: pnpm turbo --filter "@trpc/*" build | |
- run: pnpm test-ci | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
# only use token if not a fork PR | |
token: ${{ github.event.pull_request.head.repo.fork == false && secrets.CODECOV_TOKEN || '' }} | |
e2e: | |
# only run on PRs | |
if: github.event_name == 'pull_request' | |
name: 'E2E-tests' | |
needs: [build] | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DATABASE: trpcdb | |
POSTGRES_USER: postgres | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
env: | |
NEXTAUTH_SECRET: supersecret | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
continue-on-error: true | |
strategy: | |
matrix: | |
dir: | |
[ | |
.experimental/next-app-dir, | |
.test/diagnostics-big-router, | |
.test/internal-types-export, | |
.test/ssg, | |
cloudflare-workers, | |
express-minimal, | |
express-server, | |
fastify-server, | |
minimal-react, | |
next-formdata, | |
next-minimal-starter, | |
next-prisma-starter, | |
next-prisma-todomvc, | |
next-prisma-sse-subscriptions, | |
soa, | |
standalone-server, | |
vercel-edge-runtime, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/setup | |
- run: pnpm turbo --filter "@trpc/*" build | |
- name: Install playwright ??? | |
# Seems like some of playwright's system deps aren't being cached, so we're making sure they are installed | |
run: | | |
cat ./examples/${{ matrix.dir }}/package.json | | |
if grep --silent '"@playwright/test"'; | |
then pnpm playwright install chromium; | |
fi | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-dev | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} build type-check --force | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-start | |
e2e-deno: | |
# only run on PRs | |
if: github.event_name == 'pull_request' | |
name: 'E2E-tests (Deno)' | |
needs: [build] | |
env: | |
NEXTAUTH_SECRET: supersecret | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
# TURBO_REMOTE_ONLY: true | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
continue-on-error: true | |
strategy: | |
matrix: | |
dir: [deno-deploy] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/setup | |
- run: pnpm turbo --filter "@trpc/*" build | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- run: deno --version | |
- run: | | |
cd ./examples/${{ matrix.dir }} | |
pnpm dlx start-server-and-test "deno run --allow-net=:8000 --allow-env ./src/index.ts" http://127.0.0.1:8000 "deno run --allow-net --allow-env ./src/client.ts" | |
e2e-bun: | |
# only run on PRs | |
if: github.event_name == 'pull_request' | |
name: 'E2E-tests (Bun)' | |
needs: [build] | |
env: | |
NEXTAUTH_SECRET: supersecret | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
# TURBO_REMOTE_ONLY: true | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
continue-on-error: true | |
strategy: | |
matrix: | |
dir: [bun] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/setup | |
- run: pnpm turbo --filter "@trpc/*" build | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- run: bun --version | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-dev | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} build type-check | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-start | |
e2e-legacy-node: | |
# only run on PRs | |
if: github.event_name == 'pull_request' | |
needs: [build] | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DATABASE: trpcdb | |
POSTGRES_USER: postgres | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
env: | |
NEXTAUTH_SECRET: supersecret | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
continue-on-error: true | |
strategy: | |
matrix: | |
dir: | |
[ | |
next-prisma-starter, | |
next-prisma-websockets-starter, | |
next-prisma-todomvc, | |
] | |
node-start: ['18.x'] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/setup | |
- run: pnpm turbo --filter "@trpc/*" build | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-start }} | |
cache: 'pnpm' | |
- run: node -v | |
- name: Install playwright ??? | |
# Seems like some of playwright's system deps aren't being cached, so we're making sure they are installed | |
run: | | |
cat ./examples/${{ matrix.dir }}/package.json | | |
if grep --silent '"@playwright/test"'; | |
then pnpm playwright install chromium; | |
fi | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-dev | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} build type-check | |
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-start |