This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
Merge pull request #336 from pacoorozco/dependabot/composer/spatie/la… #462
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 ssham with MySQL | |
on: | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
- '**.yml' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
- '**.yml' | |
jobs: | |
ssham: | |
name: PHP ${{ matrix.php-versions }} | |
runs-on: ubuntu-latest | |
env: | |
DB_DATABASE: testing | |
DB_USERNAME: root | |
DB_PASSWORD: password | |
BROADCAST_DRIVER: log | |
CACHE_DRIVER: redis | |
QUEUE_CONNECTION: redis | |
SESSION_DRIVER: redis | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: testing | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
redis: | |
image: redis | |
ports: | |
- 6379/tcp | |
options: --health-cmd="redis-cli 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 "file_exists('.env') || copy('.env.example', '.env');" | |
php artisan key:generate | |
- 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: | | |
vendor/bin/phpunit --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 |