Skip to content

Commit

Permalink
Update tests configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Mar 15, 2024
1 parent 3e35cba commit dca7e95
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 90 deletions.
138 changes: 48 additions & 90 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,95 +32,53 @@ jobs:
- name: Execute tests
run: composer test

# mysql_57:
# runs-on: ubuntu-22.04
#
# services:
# mysql:
# image: mysql:5.7
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# MYSQL_DATABASE: laravel
# ports:
# - 3306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
#
# strategy:
# fail-fast: true
#
# name: MySQL 5.7
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.2
# extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
# tools: composer:v2
# coverage: none
#
# - name: Install dependencies
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 5
# max_attempts: 5
# command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
#
# - name: Execute tests
# run: vendor/bin/phpunit tests/Integration/Database
# env:
# DB_CONNECTION: mysql
# DB_COLLATION: utf8mb4_unicode_ci
#
# mysql_8:
# runs-on: ubuntu-22.04
#
# services:
# mysql:
# image: mysql:8
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# MYSQL_DATABASE: laravel
# ports:
# - 3306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
#
# strategy:
# fail-fast: true
#
# name: MySQL 8.0
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.2
# extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
# tools: composer:v2
# coverage: none
#
# - name: Install dependencies
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 5
# max_attempts: 5
# command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
#
# - name: Execute tests
# run: vendor/bin/phpunit tests/Integration/Database
# env:
# DB_CONNECTION: mysql
#
mysql:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ "8.2", "8.3" ]
laravel: [ "10.0", "11.0" ]
mysql: [ "5.7", "8.0", "8.1", "8.2", "8.3" ]

name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, MySQL ${{ matrix.mysql }}

services:
mysql:
image: mysql:${{ matrix.mysql }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
coverage: xdebug

- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: composer require laravel/framework:^${{ matrix.laravel }}

- name: Execute tests
run: composer test
env:
DB_CONNECTION: mysql
DB_COLLATION: utf8mb4_unicode_ci
MYSQL_HOST: 127.0.0.1

postgres:
runs-on: ubuntu-latest

Expand All @@ -139,7 +97,7 @@ jobs:
ports:
- 5432:5432
env:
POSTGRES_DB: default
POSTGRES_DB: laravel
POSTGRES_USER: root
POSTGRES_PASSWORD: root

Expand Down
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</source>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_DATABASE" value="laravel"/>
<env name="DB_USERNAME" value="root"/>
<env name="DB_PASSWORD" value="root"/>
</php>
Expand Down

0 comments on commit dca7e95

Please sign in to comment.