Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into main
  • Loading branch information
stanislawfortonski committed Dec 27, 2020
2 parents c836d5e + 8f7e177 commit cc77cf8
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,39 @@ jobs:

runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.DB_PASSWORD }}
MYSQL_DATABASE: test_laravel_blog
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Install Node Dependencies
run: npm install
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
run: php -r "file_exists('.env') || copy('.env.testing', '.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: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
DB_CONNECTION: mysql
DB_DATABASE: test_laravel_blog
DB_USER: root
DB_PORT: 33306
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: |
php artisan migrate --seed
vendor/phpunit/phpunit/phpunit

0 comments on commit cc77cf8

Please sign in to comment.