diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 39717ca..859e3fa 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -8,7 +8,14 @@ # name: Code Quality Analysis -on: [ push, pull_request ] +on: + push: + branches: + - dev + pull_request: + branches: + - dev + - main jobs: eduframe: @@ -17,12 +24,11 @@ jobs: runs-on: ubuntu-latest services: mysql: - # https://hub.docker.com/_/mariadb + # https://hub.docker.com/_/mysql image: mysql:8.0 env: - MYSQL_USER: app_db - MYSQL_PASSWORD: 'root' - MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: app_db + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' ports: - 3306:3306 strategy: @@ -46,8 +52,16 @@ jobs: - name: Install .env run: mv .env.example .env + - name: Wait for MySQL + run: | + sudo apt-get install -y netcat + while ! nc -z 127.0.0.1 3306; do + sleep 1 + echo "Waiting for MySQL..." + done + - name: Generate SQL - run: mysql -h 127.0.0.1 -u root -proot < tests/Config/EtudiantApp.sql + run: mysql -h 127.0.0.1 -u root < tests/Config/EtudiantApp.sql - name: Install dependencies run: composer self-update && composer install && composer dump-autoload