Merge pull request #47 from linuxjuggler/add-example

adding laravel with mysql example
This commit is contained in:
Shivam Mathur 2019-10-03 19:52:45 +05:30 committed by GitHub
commit 0f97f445fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 0 deletions

View File

@ -129,6 +129,11 @@ jobs:
```
### Examples
- [Laravel](./example/laravel.yml)
## :scroll: License
The scripts and documentation in this project are released under the [MIT License](LICENSE). This project has multiple [dependencies](https://github.com/shivammathur/setup-php/network/dependencies) and their licenses can be found in their respective repositories.

58
example/laravel.yml Normal file
View File

@ -0,0 +1,58 @@
name: Laravel
on: [push, pull_request]
jobs:
phpunit:
name: PHPUnit (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ubuntu-latest
env:
DB_PASSWORD: password
BROADCAST_DRIVER: log
CACHE_DRIVER: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: laravel
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
max-parallel: 15
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install PHP
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, xdebug #optional
ini-values-csv: "post_max_size=256M, short_open_tag=On" #optional
coverage: xdebug #optional
- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Prepare the application
run: |
cp .env.example .env
php artisan key:generate
- name: Clear Config
run: php artisan config:clear
- name: Run Migration
run: php artisan migrate -v
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}