Skip to content

Commit 455e99b

Browse files
committed
Fix tests
1 parent 643c94f commit 455e99b

3 files changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/check-prisma-migrations.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,29 @@ jobs:
3232
with:
3333
version: 9.1.2
3434

35+
# Even just starting the Docker Compose as a daemon is slow because we have to download and build the images
36+
# so, we run it in the background
37+
- name: Start Docker Compose in background
38+
uses: JarvusInnovations/background-action@v1.0.7
39+
with:
40+
run: docker compose -f docker/dependencies/docker.compose.yaml up -d &
41+
# we don't need to wait on anything, just need to start the daemon
42+
wait-on: /dev/null
43+
tail: true
44+
wait-for: 3s
45+
log-output-if: true
46+
3547
- name: Install dependencies
3648
run: pnpm install --frozen-lockfile
49+
50+
- name: Wait on Postgres
51+
run: pnpm run wait-until-postgres-is-ready:pg_isready
3752

38-
- name: Start Postgres shadow DB
39-
run: docker run -d --name postgres-prisma-diff-shadow -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=PLACEHOLDER-PASSWORD--dfaBC1hm1v -e POSTGRES_DB=postgres -p 5432:5432 postgres:latest
40-
41-
- name: Check for differences in Prisma schema and migrations
42-
run: cd apps/backend && pnpm run prisma migrate diff --from-migrations ./prisma/migrations --to-schema-datamodel ./prisma/schema.prisma --shadow-database-url postgres://postgres:PLACEHOLDER-PASSWORD--dfaBC1hm1v@localhost:5432/postgres --exit-code
53+
- name: Build packages
54+
run: pnpm run build:packages
55+
56+
- name: Initialize database
57+
run: pnpm run db:init
58+
59+
- name: Check for differences in Prisma schema and current DB
60+
run: cd apps/backend && pnpm run prisma migrate diff --from-url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe --to-schema-datamodel ./prisma/schema.prisma --shadow-database-url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/shadow_db --exit-code

docker/server/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if [ "$STACK_SKIP_MIGRATIONS" = "true" ]; then
3737
echo "Skipping migrations."
3838
else
3939
echo "Running migrations..."
40-
prisma migrate deploy --schema=./apps/backend/prisma/schema.prisma
40+
pnpm run db:migrate
4141
fi
4242

4343
if [ "$STACK_SKIP_SEED_SCRIPT" = "true" ]; then

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
"build:backend": "pnpm pre && turbo run build --filter=@stackframe/stack-backend...",
1515
"build:dashboard": "pnpm pre && turbo run build --filter=@stackframe/stack-dashboard...",
1616
"build:demo": "pnpm pre && turbo run build --filter=demo-app...",
17-
"build:docs": "pnpm run build:packages-only && pnpm run build:backend && turbo run generate-openapi-fumadocs && pnpm run --filter=@stackframe/stack-docs generate-docs && pnpm run --filter=@stackframe/stack-docs generate-openapi-docs && turbo run build --filter=@stackframe/stack-docs",
17+
"build:docs": "pnpm run build:packages && pnpm run build:backend && turbo run generate-openapi-fumadocs && pnpm run --filter=@stackframe/stack-docs generate-docs && pnpm run --filter=@stackframe/stack-docs generate-openapi-docs && turbo run build --filter=@stackframe/stack-docs",
1818
"build:packages": "pnpm pre && turbo run build --filter=./packages/*",
19-
"build:packages-only": "turbo run build --filter=./packages/*",
2019
"claude-code": "pnpm pre && npx -y @anthropic-ai/claude-code@latest",
2120
"cmux": "pnpm pre && npx -y cmux@latest",
2221
"codebuff": "pnpm pre && npx codebuff",
@@ -63,7 +62,7 @@
6362
"generate-keys": "pnpm pre && turbo run generate-keys",
6463
"generate-sdks": "npx --package=tsx tsx ./scripts/generate-sdks.ts",
6564
"generate-sdks:watch": "chokidar --silent -c 'pnpm run generate-sdks' './packages/template' --ignore './packages/template/package.json' --ignore '**/node_modules/**' --ignore '**/dist/**' --ignore '**/.turbo/**' --throttle 2000",
66-
"generate-docs": "pnpm run build:packages-only && turbo run generate-openapi-fumadocs && pnpm run --filter=@stackframe/stack-docs generate-docs && pnpm run --filter=@stackframe/stack-docs generate-openapi-docs",
65+
"generate-docs": "pnpm run build:packages && turbo run generate-openapi-fumadocs && pnpm run --filter=@stackframe/stack-docs generate-docs && pnpm run --filter=@stackframe/stack-docs generate-openapi-docs",
6766
"generate-docs:watch": "chokidar --silent -c 'pnpm run generate-docs' './docs/templates' --throttle 2000",
6867
"generate-openapi-docs:watch": "chokidar --silent -c 'pnpm run --filter=@stackframe/stack-docs generate-openapi-docs' './docs/public/openapi/{admin,client,server,webhooks}.json' --throttle 2000"
6968
},

0 commit comments

Comments
 (0)