Test Postgres in the CI
This commit is contained in:
parent
a6cae8f878
commit
8f3b9df1e1
|
@ -28,4 +28,14 @@ test:
|
||||||
paths:
|
paths:
|
||||||
- deno-test.xml
|
- deno-test.xml
|
||||||
reports:
|
reports:
|
||||||
junit: deno-test.xml
|
junit: deno-test.xml
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
stage: test
|
||||||
|
script: deno task db:migrate
|
||||||
|
services:
|
||||||
|
- postgres:16
|
||||||
|
variables:
|
||||||
|
DITTO_NSEC: nsec1zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs4rm7hz
|
||||||
|
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
|
||||||
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
@ -5,6 +5,7 @@
|
||||||
"start": "deno run -A src/server.ts",
|
"start": "deno run -A src/server.ts",
|
||||||
"dev": "deno run -A --watch src/server.ts",
|
"dev": "deno run -A --watch src/server.ts",
|
||||||
"hook": "deno run --allow-read --allow-run --allow-write https://deno.land/x/deno_hooks@0.1.1/mod.ts",
|
"hook": "deno run --allow-read --allow-run --allow-write https://deno.land/x/deno_hooks@0.1.1/mod.ts",
|
||||||
|
"db:migrate": "deno run -A scripts/db-migrate.ts",
|
||||||
"debug": "deno run -A --inspect src/server.ts",
|
"debug": "deno run -A --inspect src/server.ts",
|
||||||
"test": "DATABASE_URL=\"sqlite://:memory:\" deno test -A --junit-path=./deno-test.xml",
|
"test": "DATABASE_URL=\"sqlite://:memory:\" deno test -A --junit-path=./deno-test.xml",
|
||||||
"check": "deno check src/server.ts",
|
"check": "deno check src/server.ts",
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { DittoDB } from '@/db/DittoDB.ts';
|
||||||
|
|
||||||
|
const kysely = await DittoDB.getInstance();
|
||||||
|
await kysely.destroy();
|
||||||
|
|
||||||
|
Deno.exit();
|
Loading…
Reference in New Issue