Skip to content

run-tests

run-tests #1317

Workflow file for this run

name: run-tests
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2, 8.1]
laravel: [10.0]
name: P${{ matrix.php }} - L${{ matrix.laravel }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: model_uuid
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring, pdo, sqlite, pdo_sqlite
coverage: none
- name: Install dependencies
run: |
composer require "illuminate/contracts=${{ matrix.laravel }}" --prefer-dist --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Lint
run: vendor/bin/pint --test
- name: Execute tests
run: vendor/bin/phpunit
env:
DB_CONNECTION: mysql
DB_DATABASE: model_uuid
DB_USERNAME: root
DB_PORT: ${{ job.services.mysql.ports[3306] }}