diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index ae9ad1a..0ca187b 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -1,4 +1,4 @@ -name: analyze +name: Analyse on: push: @@ -8,31 +8,31 @@ on: jobs: phpstan: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-8.1-1 - restore-keys: | - ${{ runner.os }}-php-8.1-1 - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: | - composer install --no-interaction --no-progress - composer dump - - - name: Run analyse phpstan - run: vendor/bin/phpstan analyse --error-format github + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }} + restore-keys: | + ${{ runner.os }}-php-8.3- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer install --no-interaction --no-progress + composer dump + + - name: Run analyse phpstan + run: vendor/bin/phpstan analyse --error-format github diff --git a/.github/workflows/style_fix.yml b/.github/workflows/style_fix.yml index 4603851..7503457 100644 --- a/.github/workflows/style_fix.yml +++ b/.github/workflows/style_fix.yml @@ -1,45 +1,41 @@ -name: style_fix +name: Style fix on: push: branches: [master] - pull_request: - branches: [master] jobs: - style: - + style-fix: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, exif - coverage: xdebug - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-8.1-1 - restore-keys: | - ${{ runner.os }}-php-8.1-1 - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: | - composer install --no-interaction --no-progress - composer dump - - - name: Fix styles - run: vendor/bin/php-cs-fixer fix - - - uses: EndBug/add-and-commit@v9 - - - name: Run style - run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }} + restore-keys: | + ${{ runner.os }}-php-8.3- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer install --no-interaction --no-progress + composer dump + + - name: Fix styles + run: vendor/bin/php-cs-fixer fix + + - name: Run style + run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit + + - uses: EndBug/add-and-commit@v9 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f0c818..fcaf27a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: tests +name: Tests on: push: @@ -11,45 +11,59 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: true matrix: - php: ['8.2', '8.1', '8.0'] - laravel: [9.*, 10.*] + php: [8.0, 8.1, 8.2, 8.3] + laravel: [9.*, 10.*, 11.*] include: - laravel: 9.* testbench: 7.* - laravel: 10.* testbench: 8.* + - laravel: 11.* + testbench: 9.* exclude: + - laravel: 9.* + php: 8.3 - laravel: 10.* php: 8.0 + - laravel: 11.* + php: 8.0 + - laravel: 11.* + php: 8.1 steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: curl, pdo, sqlite, pdo_sqlite - - - name: Install SQLite 3 - run: sudo apt-get install sqlite3 - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - - ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }} - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --prefer-stable --prefer-dist --no-interaction --no-suggest - - - - name: Run test phpunit - run: vendor/bin/phpunit + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: curl, pdo, sqlite, pdo_sqlite + + - name: Install SQLite 3 + run: | + sudo apt-get update + sudo apt-get install sqlite3 + + - name: Validate composer.json + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --prefer-stable --prefer-dist --no-interaction + + - name: Run test phpunit + run: vendor/bin/phpunit --stop-on-error --stop-on-failure diff --git a/composer.json b/composer.json index d353a15..1b37047 100644 --- a/composer.json +++ b/composer.json @@ -11,14 +11,14 @@ ], "require": { "php": "^8.0", - "laravel/framework": "^9.0|^10.0" + "laravel/framework": "^9.0|^10.0|^11.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", "nunomaduro/larastan": "^2.0", - "orchestra/testbench": "^7.5|^8.0", + "orchestra/testbench": "^7.5|^8.0|^9.0", "phpstan/phpstan": "^1.2", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.3|^10.0|^10.5" }, "autoload": { "psr-4": { @@ -46,4 +46,4 @@ }, "minimum-stability": "dev", "prefer-stable": true -} +} \ No newline at end of file