diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 31cd93e..53f8edd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,70 +2,94 @@ name: Run tests on: push: - branches: [main] + branches: + - main paths-ignore: - - "docs/**" - - "README.md" + - docs/** + - README.md pull_request: - branches: [main] + branches: + - main jobs: vite: - if: ${{ !startsWith(github.event.head_commit.message, 'release:') }} + if: "${{ !startsWith(github.event.head_commit.message, 'release:') }}" + + runs-on: ${{ matrix.os }} + + strategy: matrix: - node-version: [16.x] - os: [ubuntu-latest, windows-latest] + node-version: + - 16.x + os: + - ubuntu-latest + - windows-latest + + name: Vite - Node ${{ matrix.os }} - ${{ matrix.os }} + + steps: - uses: actions/checkout@v2 + - name: Install pnpm uses: pnpm/action-setup@v2.0.1 with: version: 6.24.4 + - name: Use Node ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ - cache: "pnpm" + cache: pnpm - run: pnpm install + - name: Build run: pnpm run build + - name: Test run: pnpm run test:vite php: - if: ${{ !startsWith(github.event.head_commit.message, 'release:') }} + if: "${{ !startsWith(github.event.head_commit.message, 'release:') }}" + + runs-on: ${{ matrix.os }} + + strategy: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.1, 8.0] - laravel: ["8.*", "9.*", 10.*] + php: [8.1, 8.2] + laravel: ['10.*', '11.*'] stability: [prefer-stable] include: - laravel: 10.* testbench: 8.* - - laravel: "8.*" - testbench: 6.* - - laravel: "9.*" - testbench: 7.x-dev + - laravel: 11.* + testbench: 9.* exclude: - - laravel: 10.* - php: 8.0 + - laravel: 11.* + php: 8.1 + + name: PHP ${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + + steps: - name: Checkout code uses: actions/checkout@v2 + - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -73,15 +97,18 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo coverage: none + - name: Setup problem matchers run: | echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Install dependencies run: | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction + - name: Execute tests run: vendor/bin/pest diff --git a/composer.json b/composer.json index 55cc8a8..7e3007b 100644 --- a/composer.json +++ b/composer.json @@ -17,16 +17,16 @@ "require": { "php": "^8.0", "guzzlehttp/guzzle": "^6.0|^7.2", - "illuminate/contracts": "^8.0|^9.0|^10.0", + "illuminate/contracts": "^10.0|^11.0", "spatie/ignition": "^1.3", "spatie/laravel-package-tools": "^1.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.5", - "orchestra/testbench": "^6.0|^7.0|^8.0", - "pestphp/pest": "^1.21", - "phpunit/phpunit": "^9.3", - "symfony/process": "^5.3|^6.0" + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^1.21|^2.34", + "phpunit/phpunit": "^9.3|^10.5", + "symfony/process": "^6.0|^7.0" }, "autoload": { "files": [ diff --git a/tests/Features/Commands/UpdateTsconfigCommandTest.php b/tests/Features/Commands/UpdateTsconfigCommandTest.php index 4cb23b9..e25a7d9 100644 --- a/tests/Features/Commands/UpdateTsconfigCommandTest.php +++ b/tests/Features/Commands/UpdateTsconfigCommandTest.php @@ -67,14 +67,10 @@ it('asks for confirmation before running in production', function () { sandbox(function () { - $isLaravel10OrGreater = version_compare(app()->version(), '10.0.0', '>='); - set_env('production'); this()->artisan('vite:tsconfig') ->expectsConfirmation( - question: $isLaravel10OrGreater - ? 'Are you sure you want to run this command?' - : 'Do you really wish to run this command?', + question: 'Are you sure you want to run this command?', answer: 'yes' ) ->assertExitCode(0);