-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 997 Bytes
/
ci.yml
File metadata and controls
43 lines (37 loc) · 997 Bytes
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
name: Java CI with Maven
on:
push:
branches: [ "main", "develop", "master" ]
pull_request:
branches: [ "main", "develop", "master" ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: cruddb
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--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:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn -B package --file pom.xml
env:
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/cruddb
SPRING_DATASOURCE_USERNAME: user
SPRING_DATASOURCE_PASSWORD: password