diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a641a8e8..dc3ff820 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -17,8 +17,5 @@ jobs: - uses: actions/checkout@v3 - name: Install dependencies run: composer install --prefer-dist --no-progress - - name: Laravel Pint + - name: Laravel Pint run: php vendor/bin/pint --test - - name: Unit Test - run: php vendor/bin/testbench package:test - \ No newline at end of file diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..4ee835bf --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,48 @@ +name: Tests + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "*" ] + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + php: ['8.1'] + pest: ['3.0.0'] + dependency-version: [prefer-lowest, prefer-stable] + + name: PHP ${{ matrix.php }} - ${{ matrix.os }} - Pest ${{ matrix.pest }} - ${{ matrix.dependency-version }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached, gmp + tools: composer:v2 + coverage: xdebug + + - name: Setup Problem Matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Set Pest + run: composer require pestphp/pest:^${{ matrix.pest }} --dev --no-interaction --no-update + + - name: Install PHP dependencies + run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress --ansi + + - name: Run Unit With PHPUnit + run: composer test:unit:phpunit + + - name: Run Unit With Pest + run: composer test:unit:pest \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 59570bd4..735ba0c5 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,8 +3,8 @@ namespace Portable\FilaCms\Tests; use Illuminate\Contracts\Config\Repository; -use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\File; use Orchestra\Testbench\Attributes\WithMigration; use Orchestra\Testbench\Concerns\WithWorkbench; @@ -37,8 +37,8 @@ protected function setUp(): void ->expectsQuestion('Would you like to publish the FilaCMS config?(Y/n)', 'Y') ->expectsQuestion('Would you like to run migrations(Y/n)?', 'Y') ->expectsQuestion('Would you like to add the required trait to your App\\Models\\User model?(Y/n)', 'Y') - // ->expectsQuestion('theme.css already exists, do you want to overwrite it?', 'no') - // ->expectsQuestion('tailwind.config.js already exists, do you want to overwrite it?', 'no') + ->expectsQuestion('theme.css already exists, do you want to overwrite it?', 'no') + ->expectsQuestion('tailwind.config.js already exists, do you want to overwrite it?', 'no') ->expectsOutputToContain('Finished') ->assertExitCode(0);