Skip to content

Merge pull request #492 from pacoorozco/dependabot/composer/cviebrock… #502

Merge pull request #492 from pacoorozco/dependabot/composer/cviebrock…

Merge pull request #492 from pacoorozco/dependabot/composer/cviebrock… #502

Workflow file for this run

name: Testing w/ MySQL
on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '*.md'
- '**.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '**.yml'
jobs:
app:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_DATABASE: testing
DB_USERNAME: root
DB_PASSWORD: password
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testing
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: [ '8.2' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Prepare the application
run: |
php -r "copy('.env.testing', '.env');"
- name: Run Migration
run: php artisan migrate --verbose
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Run PHPUnit
run: |
php artisan test --parallel --runner WrapperRunner --stop-on-failure --coverage-text --coverage-clover=clover.xml
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./clover.xml