diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9bb4458..3898a30 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -4,27 +4,54 @@ on: [push, pull_request] jobs: test: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: - fail-fast: true + fail-fast: false matrix: - os: [ubuntu-latest] php: - "8.0" - "8.1" + - "8.2" + - "8.3" + - "8.4" + laravel: + - "^8.12" + - "^9.0" + - "^10.0" + - "^11.0" stability: [prefer-lowest, prefer-stable] + include: + - laravel: "^11.0" + testbench: 9.* + - laravel: "^10.0" + testbench: 8.* + - laravel: "^9.0" + testbench: 7.* + - laravel: "^8.12" + testbench: "^6.23" + exclude: + - laravel: "^11.0" + php: 8.1 + - laravel: "^11.0" + php: 8.0 + - laravel: "^10.0" + php: 8.0 + - laravel: "^8.12" + php: 8.3 + - laravel: "^8.12" + php: 8.4 - name: PHP${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: PHP${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} steps: - name: Checkout code - uses: actions/checkout@v3 + 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, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: curl, mbstring, fileinfo coverage: none - name: Setup problem matchers @@ -36,10 +63,12 @@ jobs: uses: actions/cache@v2 with: path: vendor - key: composer-${{ matrix.stability }}-${{ hashFiles('composer.json') }} + key: composer-PHP${{ matrix.php }}-L${{ matrix.laravel }}-${{ matrix.stability }}-${{ hashFiles('composer.json') }} - name: Install dependencies - run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction + run: | + composer require "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" + composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index dd967db..fa2f079 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ ################################################# composer.lock vendor -.phpunit.result.cache +.phpunit.cache phpunit.xml phpcs.xml build diff --git a/composer.json b/composer.json index f30903b..7e426bf 100644 --- a/composer.json +++ b/composer.json @@ -17,16 +17,13 @@ } ], "require": { - "php": "^8.0", - "illuminate/support": "^8.12|^9.0" + "php": ">=8.0", + "illuminate/support": "^8.12|^9.0|^10.0|^11.0" }, "require-dev": { - "nunomaduro/collision": "^6.2", - "orchestra/testbench": "^6.0|^7.0", - "phpunit/phpunit": "^9.5", - "psalm/plugin-laravel": "^1.0|^2.0", - "squizlabs/php_codesniffer": "^3.6", - "vimeo/psalm": "^4.11" + "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.0|^10.0|^11.0", + "squizlabs/php_codesniffer": "^3.10" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 706e74e..3f32dd3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,19 +4,20 @@ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" + cacheDirectory=".phpunit.cache" > - - - ./app - - - - - ./tests - - - - - - + + + ./tests + + + + + + + + + ./src + + diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index 9c6cedc..3474878 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -23,6 +23,7 @@ protected function getPackageProviders($app) } /** @test */ + #[\PHPUnit\Framework\Attributes\Test] public function it_should_has_temporary_url() { $path = 'test/file.txt'; @@ -35,6 +36,7 @@ public function it_should_has_temporary_url() $response->assertOk() ->assertDownload('file.txt'); + // Sleep 2 seconds sleep(2); $response = $this->get($url);