Skip to content

Commit 4be2f7d

Browse files
committed
add PostgreSQL in CI
1 parent ff57d4c commit 4be2f7d

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ jobs:
1111
name: Build & Test Backend
1212
runs-on: ubuntu-latest
1313

14+
services:
15+
postgres:
16+
image: postgres:16
17+
env:
18+
POSTGRES_USER: postgres
19+
POSTGRES_PASSWORD: postgres
20+
POSTGRES_DB: springreact
21+
ports:
22+
- 5432:5432
23+
options: >-
24+
--health-cmd="pg_isready -U postgres"
25+
--health-interval=10s
26+
--health-timeout=5s
27+
--health-retries=5
28+
1429
steps:
1530
- name: Checkout repository
1631
uses: actions/checkout@v3
@@ -21,13 +36,13 @@ jobs:
2136
distribution: temurin
2237
java-version: '21'
2338

24-
- name: Build backend with Maven (skip tests)
39+
- name: Build backend with Maven
2540
working-directory: backend
26-
run: mvn clean package -DskipTests
41+
run: mvn clean package
2742

28-
# - name: Run backend tests (unit test only *not integration tests*)
29-
# working-directory: backend
30-
# run: mvn test -DskipITs
43+
- name: Run backend tests
44+
working-directory: backend
45+
run: mvn test
3146

3247
frontend:
3348
name: Build & Lint Frontend

0 commit comments

Comments
 (0)