I recently attempted to add PHPStan to my GitHub actions, and it failed horribly - when I then reverted my GitHub actions kept failing, and it seems like it doesn't run my PHPUnit tests. The error that it outputs is the following:
Run php artisan test --parallel
Warning: TTY mode requires /dev/tty to be read/writable.
..F.
In WorkerCrashedException.php line 36:
The command "'/home/runner/work/lectero/lectero/vendor/phpunit/phpunit/phpu
nit' '--configuration' '/home/runner/work/lectero/lectero/phpunit.xml' '--n
o-logging' '--no-coverage' '--printer' 'ParaTest\Runners\PHPUnit\Worker\Nul
lPhpunitPrinter' '--log-junit' '/tmp/PT_LNbTql' '/home/runner/work/lectero/
lectero/Modules/Fortify/Tests/Feature/FortifyHomeworkTest.php'" failed.
Exit Code: 137(Kill (terminate immediately))
Working directory: /home/runner/work/lectero/lectero
Output:
================
Error Output:
================
paratest [--bootstrap BOOTSTRAP] [--colors] [-c|--configuration CONFIGURATION] [--coverage-clover COVERAGE-CLOVER] [--coverage-cobertura COVERAGE-COBERTURA] [--coverage-crap4j COVERAGE-CRAP4J] [--coverage-html COVERAGE-HTML] [--coverage-php COVERAGE-PHP] [--coverage-test-limit COVERAGE-TEST-LIMIT] [--coverage-text [COVERAGE-TEXT]] [--coverage-xml COVERAGE-XML] [--exclude-group EXCLUDE-GROUP] [--filter FILTER] [-f|--functional] [-g|--group GROUP] [-h|--help] [--log-junit LOG-JUNIT] [--log-teamcity LOG-TEAMCITY] [-m|--max-batch-size MAX-BATCH-SIZE] [--no-coverage] [--no-test-tokens] [--order-by [ORDER-BY]] [--parallel-suite] [--passthru PASSTHRU] [--passthru-php PASSTHRU-PHP] [--path PATH] [-p|--processes PROCESSES] [--random-order-seed [RANDOM-ORDER-SEED]] [--repeat [REPEAT]] [--runner RUNNER] [--stop-on-failure] [--testsuite TESTSUITE] [--tmp-dir TMP-DIR] [-v|vv|--verbose] [--whitelist WHITELIST] [--] [<path>]
Error: Process completed with exit code 1.
My build.yml file:
name: Build Tests
on:
push:
branches: [ 'master', 'develop' ]
pull_request:
branches: [ 'develop' ]
jobs:
laravel_tests:
runs-on: ubuntu-latest
name: PHPUnit
strategy:
fail-fast: true
matrix:
php: [ 8.0 ]
laravel: [ ^8.0 ]
stability: [ prefer-lowest, prefer-stable ]
services:
mysql-service:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: lectero
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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, memcached
tools: composer:v2
coverage: none
- name: Install dependencies
run: |
composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
composer update --prefer-dist --no-interaction --no-progress
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Execute tests
continue-on-error: ${{ matrix.php > 8 }}
run: php artisan test --parallel
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
php_laravel_test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.0 ]
laravel: [ ^8.0 ]
stability: [ prefer-lowest, prefer-stable ]
services:
mysql-service:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: lectero
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: PHP ${{ matrix.php }} - L${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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, memcached
tools: composer:v2
coverage: none
- name: Install dependencies
run: |
composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
composer update --prefer-dist --no-interaction --no-progress
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Execute tests
continue-on-error: ${{ matrix.php > 8 }}
run: php artisan test --parallel
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
linux_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.0 ]
laravel: [ ^8.0 ]
stability: [ prefer-lowest, prefer-stable ]
services:
mysql-service:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: lectero
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Linux
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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, memcached
tools: composer:v2
coverage: none
- name: Install dependencies
run: |
composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
composer update --prefer-dist --no-interaction --no-progress
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Execute tests
continue-on-error: ${{ matrix.php > 8 }}
run: php artisan test --parallel
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
The build.yml is the exact same as it was before the changes that was made to add PHPStan.