fix: set DATABASE_URL at job level for unit tests in PR workflow
prisma.ts throws at import time if DATABASE_URL is not set. The env var was only set on the 'Generate Prisma client' step, not 'Run unit tests'.
This commit is contained in:
@@ -15,6 +15,8 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: docker.notsosm.art/euchre-camp/ci-base:latest
|
image: docker.notsosm.art/euchre-camp/ci-base:latest
|
||||||
options: --user root
|
options: --user root
|
||||||
|
env:
|
||||||
|
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -25,8 +27,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate Prisma client
|
- name: Generate Prisma client
|
||||||
run: bun x prisma generate
|
run: bun x prisma generate
|
||||||
env:
|
|
||||||
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: bun test src/__tests__/unit/ src/__tests__/*.test.tsx src/__tests__/auth-simple.test.ts
|
run: bun test src/__tests__/unit/ src/__tests__/*.test.tsx src/__tests__/auth-simple.test.ts
|
||||||
|
|||||||
Reference in New Issue
Block a user