Skip to content

Commit

Permalink
add pg service in CI to run tests in CI against a PG db
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Jul 26, 2024
1 parent b49e6dc commit 3382729
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ on:
jobs:
validations:
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://sill:pg_password@localhost:5432/sill
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: sill
POSTGRES_PASSWORD: pg_password
POSTGRES_DB: sill
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -18,6 +29,8 @@ jobs:
- uses: bahmutov/npm-install@v1
- name: Build back
run: cd api && yarn build
- name: Migrate db
run: yarn migrate latest
- name: Fullcheck
run: yarn fullcheck
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const similarSoftwareExternalData: SoftwareExternalData = {
license: "MIT"
};

const db = new Kysely<Database>({ dialect: createPgDialect("postgresql://sill:pg_password@localhost:5433/sill") });
const db = new Kysely<Database>({ dialect: createPgDialect("postgresql://sill:pg_password@localhost:5432/sill") });

describe("pgDbApi", () => {
let dbApi: DbApiV2;
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
image: postgres:16
shm_size: 256m
ports:
- "5433:5432"
- "5432:5432"
environment:
POSTGRES_LOG_STATEMENTS: all
POSTGRES_DB: sill
Expand Down

0 comments on commit 3382729

Please sign in to comment.