Merge pull request #462 from pacoorozco/dependabot/composer/spatie/la… #461
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.1' ] | |
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@v2 | |
- 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 |