Skip to content

Update plugin io.spring.dependency-management to v1.1.5 #245

Update plugin io.spring.dependency-management to v1.1.5

Update plugin io.spring.dependency-management to v1.1.5 #245

Workflow file for this run

name: Java CI with Gradle
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle wrapper
run: ./gradlew build --no-daemon
- name: Run app and test health
run: |
BOOT_WAIT_SECONDS=10
LOG_FILE=app.log
# start app in background
java -jar build/libs/springboots2idemo-*.jar > $LOG_FILE 2>&1 &
# wait for server start and test health
sleep $BOOT_WAIT_SECONDS
HEALTH=$(curl http://localhost:9000/health)
# stop app
PID=$(ps -ef | grep "springboots2idemo-" | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo App is already stopped or did not start
exit 1
else
echo "stop app (kill $PID)"
kill $PID
fi
# print app logs
echo "-- logs --"
cat $LOG_FILE
rm -f $LOG_FILE
# test app health
echo "-- test --"
if [ "$HEALTH" = '{"status":"UP"}' ]; then
echo "App started healthy"
else
echo "App not healthy"
exit 1
fi