Skip to content

Update actions/cache to v2 #5

Update actions/cache to v2

Update actions/cache to v2 #5

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4]
dependency-version: [prefer-lowest, prefer-stable]
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Copy ENV Laravel Configuration for CI
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Install dependencies
run: |
composer install
- name: Generate key
run: php artisan key:generate
- name: Create database and run migrations
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS shark;'
php artisan migrate:refresh --seed
- name: Build assets
run: |
npm install
npm run production
- name: Execute tests
run: vendor/bin/phpunit
env:
DB_DATABASE: shark
DB_USERNAME: root
DB_PASSWORD: root