Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: attempt 1 at fix postgres in ci #3

Merged
merged 4 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
branches:
- main


env:
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
DATABASE_NAME: postgres

jobs:
ci:
runs-on: ubuntu-latest
Expand All @@ -17,6 +24,8 @@ jobs:
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
Expand All @@ -38,4 +47,4 @@ jobs:
- run: npm ci
- run: npm run build:dev
- run: npm run test:unit
- run: DATABASE_USER=postgres DATABASE_PASSWORD=postgres DATABASE_HOST=postgres npm run test:integration
- run: npm run test:integration
1 change: 1 addition & 0 deletions apps/backend/config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"password": "ADMIN_PASSWORD"
},
"database": {
"databaseName": "DATABASE_NAME",
"user": "DATABASE_USER",
"password": "DATABASE_PASSWORD",
"host": "DATABASE_HOST"
Expand Down
1 change: 1 addition & 0 deletions apps/backend/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"password": null
},
"database": {
"databaseName": null,
"user": null,
"password": null,
"host": null
Expand Down
1 change: 1 addition & 0 deletions apps/backend/config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"password": "admin"
},
"database": {
"databaseName": "neighbourly",
"user": "local",
"password": "local",
"host": "localhost"
Expand Down
2 changes: 0 additions & 2 deletions apps/backend/src/core/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class Application {
container.bind<DatabaseClient>(symbols.databaseClient, () =>
DatabaseClientFactory.create({
clientType: DatabaseClientType.postgres,
databaseName: 'neighbourly',
minPoolConnections: 1,
maxPoolConnections: 10,
port: 5432,
Expand All @@ -66,7 +65,6 @@ export class Application {
container.bind<DatabaseClient>(symbols.entityEventsDatabaseClient, () =>
DatabaseClientFactory.create({
clientType: DatabaseClientType.postgres,
databaseName: 'neighbourly',
minPoolConnections: 1,
maxPoolConnections: 10,
port: 5432,
Expand Down
3 changes: 3 additions & 0 deletions apps/backend/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const configSchema = Type.Object({
}),
logLevel: Type.Enum(LogLevel),
database: Type.Object({
databaseName: Type.String({
minLength: 1,
}),
user: Type.String({
minLength: 1,
}),
Expand Down
Loading