Skip to content

fix github actions

fix github actions #3

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: sampledb
MYSQL_USER: sampleuser
MYSQL_PASSWORD: samplepassword
options: >-
--health-cmd="mysqladmin ping -h localhost --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Wait for MySQL to be ready
run: |
echo "Waiting for MySQL to be ready..."
for i in {1..10}; do
if mysqladmin ping -h 127.0.0.1 --silent; then
echo "MySQL is ready!"
break
fi
echo "MySQL not ready yet. Retrying in 5 seconds..."
sleep 5
done
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Build with Gradle
run: ./gradlew build