Skip to content

added username and password to mysql command in laravel.yml #5

added username and password to mysql command in laravel.yml

added username and password to mysql command in laravel.yml #5

Workflow file for this run

name: Laravel
defaults:
run:
working-directory: html/
on:
push:
branches: [ "production" ]
pull_request:
branches: [ "production" ]
jobs:
laravel-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql/mysql-server:8.0
env:
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_DATABASE: 'couponpocket'
MYSQL_USER: 'couponpocket'
MYSQL_PASSWORD: 'password'
ports:
- 3306:3306
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.2'
- uses: actions/checkout@v3
- name: Set up MySQL
run: mysql -ucouponpocket -ppassword < ../database/couponpocket.sql
- name: initialize database
run: mysql
- name: Copy .env
run: php -r "file_exists('.env') || copy('../.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_HOST: '127.0.0.1'
run: vendor/bin/phpunit