-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.5 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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