-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1006 Bytes
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Java CI with Maven
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16.3
env:
POSTGRES_DB: disasterdb
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U user -d disasterdb"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: maven
- name: Wait for PostgreSQL to be ready
run: |
until pg_isready -h localhost -p 5432 -U user; do
echo "Waiting for PostgreSQL..."
sleep 5
done
- name: Build and Run Tests
run: mvn clean install