tests #40
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: tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
linux_tests: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: forge | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.2, 8.3] | |
phpunit: ['11.0', '11.4'] | |
phpstan: ['1.12'] | |
paratest: ['7.6'] | |
larastan: ['2.5', '2.9'] | |
name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - with Paratest ${{ matrix.paratest }} - PHPStan ${{ matrix.phpstan }} - Larastan ${{ matrix.larastan }} | |
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, gd, redis, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp, xml, xdebug, :php-psr | |
ini-values: error_reporting=E_ALL | |
tools: composer:v2 | |
coverage: xdebug | |
env: | |
REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 | |
REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev | |
- name: Set Framework version | |
run: composer config version "11.x-dev" | |
- name: Set minimum PHP 8.2 versions | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer require guzzlehttp/psr7:^2.4 --no-interaction --no-update | |
- name: Set PHPUnit | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update | |
- name: Set Paratest | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer require brianium/paratest:^${{ matrix.paratest }} --dev --no-interaction --with-all-dependencies | |
- name: Set PHPStan | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer require phpstan/phpstan:^${{ matrix.phpstan }} --dev --no-interaction --no-update | |
- name: Set Larastan | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer require larastan/larastan:^${{ matrix.larastan }} --dev --no-interaction --no-update | |
- 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: php artisan test --parallel --configuration="phpunit.xml" --coverage-clover=build/logs/clover.xml | |
env: | |
DB_CONNECTION: sqlite | |
DB_DATABASE: ":memory:" | |
- name: Execute PHPStan | |
run: vendor/bin/phpstan --configuration="phpstan.neon.dist" | |
- name: Upload coverage results to Coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
composer global require php-coveralls/php-coveralls | |
php-coveralls --coverage_clover=build/logs/clover.xml -v |