-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.44 KB
/
check-server-start.yml
File metadata and controls
61 lines (51 loc) · 1.44 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Check Server Startup
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
check-server-start:
name: Ensure Server Starts Successfully
runs-on: ubuntu-latest
timeout-minutes: 5
services:
postgres:
image: postgres:18
env:
POSTGRES_DB: harmonia
POSTGRES_USER: postgres
POSTGRES_PASSWORD: harmonia
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
gradle-version: '9.2.0'
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
- name: Start Spring Boot and check log
run: |
./gradlew bootRun > boot.log 2>&1 & SERVER_PID=$!
# Wait for a few seconds to let server start
sleep 240
# Kill the process to avoid timeout
kill $SERVER_PID || true
# Look for Spring Boot banner
if grep -q "Tomcat started on port 8080" boot.log; then
echo "✅ Spring Boot started successfully."
else
echo "❌ Server did not start successfully!"
cat boot.log
exit 1
fi