Skip to content

Fix: tests

Fix: tests #44

Workflow file for this run

name: run-tests
on:
workflow_run:
workflows:
- pint
types:
- completed
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ["7.4", "8.0", "8.1", "8.2", "8.3"]
laravel: ["7.*", 8.*', "9.*", "10.*", "11.*"]
stability: [prefer-stable]
include:
- laravel: "11.*"
testbench: "9.*"
- laravel: "10.*"
testbench: "8.*"
- laravel: "9.*"
testbench: "7.*"
- laravel: "8.*"
testbench: ^6.23
carbon: "^2.63"
- laravel: "7.*"
testbench: "5.*"
carbon: "^2.63"
exclude:
- php: "8.1"
laravel: "7.*"
- php: "8.2"
laravel: "7.*"
- php: "8.3"
laravel: "7.*"
- php: "8.0"
laravel: "7.*"
- php: "8.1"
laravel: "8.*"
- php: "8.2"
laravel: "8.*"
- php: "8.3"
laravel: "8.*"
- php: "7.4"
laravel: "9.*"
- php: "7.4"
laravel: "10.*"
- php: "8.0"
laravel: "10.*"
- php: "7.4"
laravel: "11.*"
- php: "8.0"
laravel: "11.*"
- php: "8.1"
laravel: "11.*"
name: PHP${{ matrix.php }} - Laravel_${{ matrix.laravel }} - ${{ matrix.stability }}
services:
mysql:
image: mysql:8.0
env:
MYSQL_USER: user
MYSQL_PASSWORD: secret
MYSQL_DATABASE: laravel_health
MYSQL_ROOT_PASSWORD: secretroot
ports:
- 3306
options: '--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3'
redis:
image: redis
ports:
- '6379:6379'
options: '--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Laravel 9+ dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
if: (matrix.laravel == '9.*' || matrix.laravel == '10.*' || matrix.laravel == '11.*') && matrix.php != ''
- name: Install Laravel 7/8 dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
if: (matrix.laravel == '7.*' || matrix.laravel == '8.*') && matrix.php != ''
- name: Execute tests
run: vendor/bin/pest
env:
DB_USERNAME: user
DB_PASSWORD: secret
DB_PORT: ${{ job.services.mysql.ports[3306] }}
REDIS_PORT: 6379
if: matrix.testbench != '' && matrix.php != ''