Skip to content

Bugs en testing

Bugs en testing #7

Workflow file for this run

name: Ejecutar Tests Laravel
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
MYSQL_DATABASE: laravel
MYSQL_USER: ${{ secrets.MYSQL_USER }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout del código fuente
uses: actions/checkout@v2
- name: Configurar PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Actualizacion de dependencias
run: composer install
- name: Instalar dependencias
run: composer install
- name: Copiar archivo .env
run: cp .env.example .env
- name: Generar clave de aplicación
run: php artisan key:generate
- name: Esperar a que MySQL esté disponible
run: |
until mysqladmin ping -h127.0.0.1 -uroot -p; do
echo "Esperando a que MySQL esté disponible..."
sleep 5
done
- name: Ejecutar migraciones
run: php artisan migrate --force
- name: Ejecutar seeders
run: php artisan db:seed
- name: Ejecutar tests
run: php artisan test