Skip to content

Laravel 11.x Shift #183

Laravel 11.x Shift

Laravel 11.x Shift #183

Workflow file for this run

name: Test Build
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: PHP 8.2, Laravel 10.x
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Cache Composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: php-8.2-laravel-10.*-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-8.2-laravel-10.*-composer-
- name: Cache npm dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-
- name: Copy ENV Laravel Configuration for CI
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-progress
composer require "orchestra/testbench:9.*" --no-interaction --no-update
npm install
- name: Build Assets
run: npm run prod
- name: Generate key
run: php artisan key:generate
- name: Create DB and schemas
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/consoles.sqlite
run: |
mkdir -p database
touch database/consoles.sqlite
php artisan migrate
- name: Run PHP tests
run: vendor/bin/phpunit