Skip to content

Run tests on mysql and postgres #123

Run tests on mysql and postgres

Run tests on mysql and postgres #123

Workflow file for this run

name: run-tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
sqlite:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: true
matrix:
os: [ubuntu, windows]
php: [8.2, 8.1]
laravel: [10.*]
stability: [lowest, stable]

Check failure on line 19 in .github/workflows/run-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/run-tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 19
name: [${{ matrix.os }}/sqlite] ${{ matrix.php }}/${{ matrix.laravel }} - ${{ matrix.stability }}
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, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :php-psr
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 dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
env:
DB_CONNECTION: sqlite
mysql:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: true
matrix:
os: [ ubuntu, windows ]
php: [ 8.2, 8.1 ]
laravel: [ 10.* ]
stability: [ lowest, stable ]
name: [ ${ { matrix.os } }/mysql ] ${{ matrix.php }}/${{ matrix.laravel }} - ${{ matrix.stability }}
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: forge
ports:
- 33306: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, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :php-psr
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 dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
env:
DB_CONNECTION: mysql
DB_USER: root
DB_PASSWORD: password
pgsql:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: true
matrix:
os: [ ubuntu, windows ]
php: [ 8.2, 8.1 ]
laravel: [ 10.* ]
stability: [ lowest, stable ]
name: [ ${ { matrix.os } }/pgsql ] ${{ matrix.php }}/${{ matrix.laravel }} - ${{ matrix.stability }}
services:
postgresql:
image: postgres:14
env:
POSTGRES_DB: forge
POSTGRES_USER: forge
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd=pg_isready --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, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :php-psr
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 dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
env:
DB_CONNECTION: pgsql
DB_PASSWORD: password