Skip to content

feat: use trpc 11 #1448

feat: use trpc 11

feat: use trpc 11 #1448

Workflow file for this run

# this workflow will run on every pr to make sure the project is following the guidelines
# after labeler, run other actions with strict permissions
name: E2E Tests
on:
pull_request:
branches:
- "*"
paths:
- "cli/**/*"
merge_group:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build-t3-app:
runs-on: ubuntu-latest
# if: |
# contains(github.event.pull_request.labels.*.name, '📌 area: cli') ||
# contains(github.event.pull_request.labels.*.name, '📌 area: t3-app')
strategy:
matrix:
trpc: ["true", "false"]
tailwind: ["true", "false"]
nextAuth: ["true", "false"]
prisma: ["true", "false"]
appRouter: ["true", "false"]
drizzle: ["true", "false"]
dbType: ["planetscale", "sqlite", "mysql", "postgres"]
name: "Build and Start T3 App ${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }}-${{ matrix.drizzle}}-${{ matrix.appRouter }}-${{ matrix.dbType }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check valid matrix
id: matrix-valid
run: |
echo "continue=${{ (matrix.prisma == 'false' || matrix.drizzle == 'false') && (matrix.drizzle == 'true' || matrix.prisma == 'true' || matrix.dbType == 'sqlite') }}" >> $GITHUB_OUTPUT
- name: Install Node.js
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2.2.4
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm store directory
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
run: pnpm install
- run: pnpm turbo --filter=create-t3-app build
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
# has to be scaffolded outside the CLI project so that no lint/tsconfig are leaking
# through. this way it ensures that it is the app's configs that are being used
# FIXME: this is a bit hacky, would rather have --packages=trpc,tailwind,... but not sure how to setup the matrix for that
- run: cd cli && pnpm start ../../ci-${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }}-${{ matrix.drizzle}}-${{ matrix.appRouter }}-${{ matrix.dbType }} --noGit --CI --trpc=${{ matrix.trpc }} --tailwind=${{ matrix.tailwind }} --nextAuth=${{ matrix.nextAuth }} --prisma=${{ matrix.prisma }} --drizzle=${{ matrix.drizzle }} --appRouter=${{ matrix.appRouter }} --dbProvider=${{ matrix.dbType }}
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
- run: cd ../ci-${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }}-${{ matrix.drizzle}}-${{ matrix.appRouter }}-${{ matrix.dbType }} && pnpm build
if: ${{ steps.matrix-valid.outputs.continue == 'true' }}
env:
NEXTAUTH_SECRET: foo
DATABASE_URL: mysql://root:root@localhost:3306/test # can't use url from example env cause we block that in t3-env
DISCORD_CLIENT_ID: bar
DISCORD_CLIENT_SECRET: baz
build-t3-app-with-bun:
runs-on: ubuntu-latest
name: "Build and Start T3 App with Bun"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# First install everything and build the CLI with Node
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- run: pnpm turbo --filter=create-t3-app build
# Then, run the CLI and build the generated app with Bun
# Let's just build a full app with Bun, we don't need the matrix here
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: cd cli && bun run dist/index.js ../../ci-bun --default
- name: We should have a Bun lockfile
run: |
if [ ! -f "../ci-bun/bun.lockb" ]; then
echo "Bun lockfile not found"
exit 1
fi
# FIXME: This doesn't actually run the build script using bun, since Next.js doesn't support it yet.
# But you should still be able to use `bun` as a package manager for any Next.js app.
# If/When Next.js supports it, we should be able to run `bun --bun run build` here to override any Node binaries.
# See: https://bun.sh/docs/cli/bunx#shebangs
- run: cd ../ci-bun && bun run build
# - run: cd ../ci-bun && bun --bun run build
env:
NEXTAUTH_SECRET: foo
DATABASE_URL: mysql://root:root@localhost:3306/test # can't use url from example env cause we block that in t3-env
DISCORD_CLIENT_ID: bar
DISCORD_CLIENT_SECRET: baz