Skip to content

Commit 9733145

Browse files
author
jawher.kallel
committed
update workflows pipeline
1 parent 11c2001 commit 9733145

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

.github/workflows/node.js.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
41
name: Node.js CI
52

63
on:
74
push:
85
branches: [ "main" ]
96
pull_request:
107
branches: [ "main" ]
11-
8+
129
jobs:
1310
build:
1411
runs-on: ubuntu-latest
1512

16-
services:
17-
postgres:
18-
image: postgres:13
19-
env:
20-
POSTGRES_USER: bookdb_owner
21-
POSTGRES_PASSWORD: FDXS5CHc1sRa
22-
POSTGRES_DB: testdb
23-
ports:
24-
- 5432:5432
25-
options: --health-cmd "pg_isready -U bookdb_owner" --health-timeout 5s --health-start-period 5s
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
2616

2717
steps:
2818
- uses: actions/checkout@v4
@@ -31,10 +21,17 @@ jobs:
3121
with:
3222
node-version: ${{ matrix.node-version }}
3323
cache: 'npm'
34-
- run: npm ci
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
3528
- name: Set up environment variables
3629
env:
37-
DATABASE_URL: postgresql://bookdb_owner:FDXS5CHc1sRa@localhost:5432/testdb
38-
run: echo "Database connection is set."
39-
- run: npm run build --if-present
40-
- run: npm test
30+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
31+
run: echo "Environment variable DATABASE_URL has been set."
32+
33+
- name: Build project
34+
run: npm run build --if-present
35+
36+
#- name: Run tests
37+
# run: npm test

0 commit comments

Comments
 (0)