Skip to content

Commit

Permalink
chore(Github action):Update node.js.yml to print db url for testing i…
Browse files Browse the repository at this point in the history
…f it's working
  • Loading branch information
Hakizimana-Clement committed Apr 19, 2024
1 parent 8e6ffb1 commit 53b742d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
env:
DB_DIALECT: postgres
DB_TEST_URL: ${{ secrets.DB_TEST_URL }}
DEV_MODE: ${{ secrets.DEV_MODE }}
DB_HOSTED_MODE: ${{ secrets.DB_HOSTED_MODE }}

strategy:
matrix:
Expand All @@ -34,6 +36,10 @@ jobs:
- name: Install dependencies
run: npm install

- name: Print DB_TEST_URL
run: |
echo "DB_TEST_URL: ${{ secrets.DB_TEST_URL }}"
- name: Run tests and build test coverage
run: npm run test:ci

Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/database/config/db.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DB_HOST_MODE === "local"
},
});

export const sequelizeConnection: Sequelize = new Sequelize(db_uri as string, {
export const sequelizeConnection: Sequelize = new Sequelize(db_uri, {
dialect: "postgres",
dialectOptions: dialect_option,
logging: true,
Expand All @@ -47,7 +47,9 @@ export const connectionToDatabase = () =>
sequelizeConnection
.authenticate()
.then(() => {
console.log("Database connected successfully.", db_uri);
sequelizeConnection.sync().then(() => {
console.log("Database connected successfully.", db_uri);
});
})
.catch((error) => {
console.error("Unable to connect to the database:", error);
Expand Down

0 comments on commit 53b742d

Please sign in to comment.