Skip to content

Commit

Permalink
#43 fix Error 2013 Lost connection to Mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoujols committed Dec 29, 2023
1 parent dfe1cd1 commit e1349da
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
#
name: Code Quality Analysis

on: [ push, pull_request ]
on:
push:
branches:
- dev
pull_request:
branches:
- dev
- main

jobs:
eduframe:
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit e1349da

Please sign in to comment.