Skip to content

chore: prepare for laravel 11 #34

chore: prepare for laravel 11

chore: prepare for laravel 11 #34

Workflow file for this run

# GitHub Action for Laravel with MySQL and Redis
name: Testing Laravel with MySQL
on: [pull_request]
jobs:
laravel:
name: Laravel ${{ matrix.laravel }} (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
env:
DB_DATABASE: logtodb
DB_USERNAME: root
DB_PASSWORD: root
BROADCAST_DRIVER: log
CACHE_DRIVER: file
QUEUE_CONNECTION: file
SESSION_DRIVER: file
# Docs: https://docs.github.com/en/actions/using-containerized-services
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: logtodb
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
laravel: [ ^10.0, ^11.0 ]
php: ['8.2', '8.3']
include:
- laravel: ^10.0
testbench: ^8.0
- laravel: ^11.0
testbench: ^9.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 7.0
# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, dom, fileinfo, mysql, mongodb
coverage: xdebug
# Local MySQL service in GitHub hosted environments is disabled by default.
# If you are using it instead of service containers, make sure you start it.
# - name: Start mysql service
# run: sudo systemctl start mysql.service
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-clover ./coverage.xml
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODE_COV_TOKEN }}
files: ./coverage.xml
verbose: true