This repository has been archived by the owner on Dec 3, 2024. It is now read-only.
Merge pull request #86 from cognitus/main #191
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: run-tests | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- '*' | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_PORT: 5432 | |
MYSQL_USER: test | |
MYSQL_PASSWORD: password | |
MYSQL_PORT: 3306 | |
jobs: | |
test: | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DB: testing | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_PORT: 5432 | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_USER: test | |
MYSQL_PASSWORD: password | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: testing | |
MYSQL_PORT: 3306 | |
ports: | |
- 3306:3306 | |
# Set health checks to wait until mysql has started | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest] | |
php: [8.1, 8.2, 8.3] | |
laravel: [10.*, 11.*] | |
stability: [prefer-lowest, prefer-stable] | |
include: | |
- laravel: 10.* | |
testbench: 8.* | |
- laravel: 11.* | |
testbench: 9.* | |
exclude: | |
- laravel: 11.* | |
php: 8.1 | |
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} | |
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, intl, gd, exif, iconv, 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 dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
- name: Execute tests | |
run: vendor/bin/pest |