Skip to content

Am I stupid, or am I stupid? #38

Am I stupid, or am I stupid?

Am I stupid, or am I stupid? #38

Workflow file for this run

name: run-tests
on: [push, pull_request]
jobs:
test:
runs-on: buildjet-4vcpu-ubuntu-2204
strategy:
matrix:
php: [ '8.0', '8.1', '8.2', '8.3' ]
laravel: [ '9.2', '9.52', '10.0', '10.39', '11.x']
exclude:
- php: '8.0'
laravel: '10.0'
- php: '8.0'
laravel: '10.39'
- php: '8.0'
laravel: '11.x'
- php: '8.1'
laravel: '11.x'
name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }}
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: no
MYSQL_USER: search_test
MYSQL_DATABASE: search_test
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres
env:
POSTGRES_PASSWORD: secret
POSTGRES_DB: search_test
ports:
- 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@master
- name: Installing PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql, pdo_pgsql
tools: composer:v2
- name: Lock Package Versions
run: |
composer require "illuminate/support:${{ matrix.laravel }}.*" --no-update -v && composer require "illuminate/console:${{ matrix.laravel }}.*" --no-update -v
- name: Testbench Version Adjustments
run: |
is_smaller_version() [[ $(echo -e "$1\n$2"|sort -V|head -1) != $2 ]]
is_smaller_version "${{ matrix.laravel }}" "9.36" && composer req "orchestra/testbench-core:7.10.2" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.34" && composer req "orchestra/testbench-core:7.8.1" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.32" && composer req "orchestra/testbench-core:7.7.1" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.12" && composer req "orchestra/testbench-core:7.4.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.7" && composer req "orchestra/testbench-core:7.3.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.6" && composer req "orchestra/testbench-core:7.2.0" --no-update
is_smaller_version "${{ matrix.laravel }}" "9.5" && composer req "orchestra/testbench-core:7.1.0" --no-update || true
- name: Composer Install
run: composer install --prefer-dist --no-progress --no-interaction
- name: Enable Postgres Trigram Extension
run: |
PGPASSWORD=secret psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d search_test -tc "CREATE EXTENSION pg_trgm;"
- name: Tests - MySQL
run: vendor/bin/phpunit --testdox
env:
DB_DATABASE: search_test
DB_USERNAME: search_test
DB_PASSWORD: secret
DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Tests - Postgres
run: vendor/bin/phpunit --testdox
env:
DB_CONNECTION: pgsql
DB_DATABASE: search_test
DB_USERNAME: postgres
DB_PASSWORD: secret
DB_PORT: ${{ job.services.postgres.ports[5432] }}
- name: Tests - SQLite
run: vendor/bin/phpunit --testdox
env:
DB_CONNECTION: sqlite
DB_DATABASE: ":memory:"