Skip to content

Laravel 11

Laravel 11 #159

Workflow file for this run

name: Tests
on:
pull_request:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
jobs:
tests:
name: PHP tests (PHP ${{ matrix.php-version }})
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.2, 8.3 ]
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: 'basic_crud_testing'
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ inputs.php-version }}
- name: Get composer cache directory
id: composer-cache
shell: bash
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --no-progress
- name: code style check
run: ./vendor/bin/pint --test
- name: Install npm dependencies
run: npm install
- name: Run Build for Production
run: npm run build
- name: Copy .env
run: cp .env.testing.example .env.testing
- name: Generate key
run: php artisan key:generate --env=testing
- name: Run tests
run: php artisan test --parallel
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github