-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (33 loc) · 944 Bytes
/
code.yaml
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
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- name: Set up Docker Compose
run: sudo apt-get install docker-compose
- name: Start Docker Compose services
run: docker-compose up -d
- name: Wait for services to be ready
run: |
echo "Waiting for services to be ready..."
while ! nc -z localhost 5432; do # Adapt this command depending on your DB or service port
sleep 2
done
- name: Build with Maven
run: mvn -B package --file pom.xml -DskipTests
- name: Run Tests
run: mvn test -Dspring.profiles.active=ci