name: Java CI with Maven on: push: branches: [ "master" ] jobs: build: runs-on: ubuntu-latest services: mysql: image: mysql:8.0 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: projet_gei_023 MYSQL_USER: user MYSQL_PASSWORD: ohQu4ood ports: - 3306:3306 options: >- --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - uses: actions/checkout@v3 - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' cache: maven - name: Setup MySQL run: | sudo systemctl start mysql mysql -e 'CREATE DATABASE IF NOT EXISTS projet_gei_023;' -uroot -proot mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';" -uroot -proot - name: Build with Maven run: mvn -B package --file pom.xml - name: Test with Maven run: mvn test