This commit is contained in:
Phan An 2022-07-29 09:53:54 +02:00
parent eea2847d15
commit 3832ca0fb3
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
2 changed files with 8 additions and 2 deletions

View file

@ -21,7 +21,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
tools: composer:v2
extensions: pdo_sqlite
- name: Install PHP dependencies

View file

@ -6,6 +6,7 @@ use App\Console\Kernel;
use App\Models\User;
use Illuminate\Contracts\Console\Kernel as Artisan;
use Illuminate\Foundation\Application;
use Throwable;
trait CreatesApplication
{
@ -28,7 +29,12 @@ trait CreatesApplication
private function prepareForTests(): void
{
$this->artisan->call('migrate');
try {
$this->artisan->call('migrate');
} catch (Throwable $e) {
\Log::error($e); // @phpcs:ignore
throw $e;
}
if (!User::count()) {
$this->artisan->call('db:seed');