Laravel Pennant Sandbox #92
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: tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
linux_tests: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: pass | |
MYSQL_DATABASE: laravel | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
redis: | |
image: redis:5.0 | |
ports: | |
- 6379:6379 | |
options: --entrypoint redis-server | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [ 8.2, 8.1 ] | |
stability: [ prefer-lowest, prefer-stable ] | |
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2 | |
coverage: xdebug | |
- name: Install dependencies | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress | |
- name: Execute phpcs | |
run: php vendor/bin/phpcs | |
- name: Initial Key | |
run: cp .env.example .env && php artisan key:generate | |
- name: Migration | |
run: php artisan migrate:fresh --seed | |
env: | |
DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
- name: Execute tests | |
run: php -d xdebug.mode=coverage vendor/bin/phpunit | |
- name: Code coverage | |
if: ${{ matrix.php == '8.1' && matrix.stability == 'prefer-stable' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./build/coverage/clover.xml |