From 431ac6ac118a69b4e6b2f39cb66fb53a011af9c6 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 15 Feb 2023 12:45:28 +0300 Subject: [PATCH] Added Laravel 10 support --- .github/workflows/code-style.yml | 35 ++++++++++ .github/workflows/laravel-7.yml | 46 ------------- .github/workflows/laravel-8.yml | 46 ------------- .github/workflows/laravel-9.yml | 46 ------------- .github/workflows/lint-check.yml | 14 ---- .github/workflows/lint-fixer.yml | 19 ------ .../workflows/{laravel-6.yml => phpunit.yml} | 42 ++++++++++-- .styleci.yml | 67 ------------------- composer.json | 18 ++--- 9 files changed, 81 insertions(+), 252 deletions(-) create mode 100644 .github/workflows/code-style.yml delete mode 100644 .github/workflows/laravel-7.yml delete mode 100644 .github/workflows/laravel-8.yml delete mode 100644 .github/workflows/laravel-9.yml delete mode 100644 .github/workflows/lint-check.yml delete mode 100644 .github/workflows/lint-fixer.yml rename .github/workflows/{laravel-6.yml => phpunit.yml} (52%) delete mode 100644 .styleci.yml diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 0000000..665db2e --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,35 @@ +name: code-style + +on: + push: + pull_request: + +permissions: write-all + +jobs: + check: + if: ${{ ! (github.event_name == 'push' && github.ref == 'refs/heads/main') }} + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Checking PHP Syntax + uses: TheDragonCode/codestyler@v2.6.2 + + fix: + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Checking PHP Syntax + uses: TheDragonCode/codestyler@v2.6.2 + with: + github_token: ${{ secrets.COMPOSER_TOKEN }} + fix: true diff --git a/.github/workflows/laravel-7.yml b/.github/workflows/laravel-7.yml deleted file mode 100644 index 0babfe7..0000000 --- a/.github/workflows/laravel-7.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Laravel 7" -on: [ push ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "8.0" ] - laravel: [ "7.0" ] - - name: PHP ${{ matrix.php }} - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: default - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Redis - uses: zhulik/redis-action@1.1.0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, pdo_mysql - coverage: none - - - name: Install dependencies - run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal:^2.6 - - - name: Execute tests - run: sudo vendor/bin/phpunit - env: - MYSQL_HOST: 127.0.0.1 diff --git a/.github/workflows/laravel-8.yml b/.github/workflows/laravel-8.yml deleted file mode 100644 index 7dbd3ec..0000000 --- a/.github/workflows/laravel-8.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Laravel 8" -on: [ push ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "8.0", "8.1" ] - laravel: [ "8.0" ] - - name: PHP ${{ matrix.php }} - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: default - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Redis - uses: zhulik/redis-action@1.1.0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, pdo_mysql - coverage: none - - - name: Install dependencies - run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal - - - name: Execute tests - run: sudo vendor/bin/phpunit - env: - MYSQL_HOST: 127.0.0.1 diff --git a/.github/workflows/laravel-9.yml b/.github/workflows/laravel-9.yml deleted file mode 100644 index 05a54ea..0000000 --- a/.github/workflows/laravel-9.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Laravel 9" -on: [ push ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "8.0", "8.1" ] - laravel: [ "9.0" ] - - name: PHP ${{ matrix.php }} - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: default - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Redis - uses: zhulik/redis-action@1.1.0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, pdo_mysql - coverage: none - - - name: Install dependencies - run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal - - - name: Execute tests - run: sudo vendor/bin/phpunit - env: - MYSQL_HOST: 127.0.0.1 diff --git a/.github/workflows/lint-check.yml b/.github/workflows/lint-check.yml deleted file mode 100644 index cf847b8..0000000 --- a/.github/workflows/lint-check.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Code-Style Check" - -on: [ push, pull_request ] - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Checking PHP Syntax - uses: TheDragonCode/codestyler@v2.6.2 diff --git a/.github/workflows/lint-fixer.yml b/.github/workflows/lint-fixer.yml deleted file mode 100644 index 1663da7..0000000 --- a/.github/workflows/lint-fixer.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Code-Style Fixer" - -on: - push: - branches: [ main ] - -jobs: - fix: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Checking PHP Syntax - uses: TheDragonCode/codestyler@v2.6.2 - with: - github_token: ${{ secrets.COMPOSER_TOKEN }} - fix: true diff --git a/.github/workflows/laravel-6.yml b/.github/workflows/phpunit.yml similarity index 52% rename from .github/workflows/laravel-6.yml rename to .github/workflows/phpunit.yml index a34967c..352d17c 100644 --- a/.github/workflows/laravel-6.yml +++ b/.github/workflows/phpunit.yml @@ -1,4 +1,5 @@ -name: "Laravel 6" +name: phpunit + on: [ push ] jobs: @@ -8,10 +9,41 @@ jobs: strategy: fail-fast: true matrix: - php: [ "8.0" ] - laravel: [ "6.0" ] + php: [ "8.0", "8.1", "8.2" ] + laravel: [ "6.0", "7.0", "8.0", "9.0", "10.0" ] + doctrine: [ "2.0", "3.0" ] + exclude: + - laravel: "6.0" + doctrine: "3.0" + + - laravel: "6.0" + php: "8.1" + + - laravel: "6.0" + php: "8.2" + + - laravel: "7.0" + doctrine: "3.0" + + - laravel: "7.0" + php: "8.1" + + - laravel: "7.0" + php: "8.2" + + - laravel: "8.0" + doctrine: "2.0" + + - laravel: "8.0" + php: "8.2" + + - laravel: "10.0" + doctrine: "2.0" + + - laravel: "10.0" + php: "8.0" - name: PHP ${{ matrix.php }} + name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, Doctrine ${{ matrix.doctrine }} services: mysql: @@ -38,7 +70,7 @@ jobs: coverage: none - name: Install dependencies - run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal:^2.6 + run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal:^${{ matrix.doctrine }} - name: Execute tests run: sudo vendor/bin/phpunit diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index cb07b4b..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,67 +0,0 @@ -preset: psr12 - -risky: true - -enabled: - - align_double_arrow - - align_equals - - align_phpdoc - - alpha_ordered_imports - - binary_operator_spaces - - blank_line_before_continue - - blank_line_before_declare - - blank_line_before_return - - blank_line_before_throw - - blank_line_before_try - - cast_spaces - - combine_consecutive_issets - - const_separation - - dir_constant - - fully_qualified_strict_types - - logical_operators - - method_separation - - no_alias_functions - - no_blank_lines_after_phpdoc - - no_blank_lines_between_traits - - no_empty_comment - - no_empty_phpdoc - - no_extra_block_blank_lines - - no_extra_consecutive_blank_lines - - no_short_bool_cast - - no_trailing_comma_in_singleline_array - - no_unneeded_control_parentheses - - no_unused_imports - - ordered_class_elements - - php_unit_construct - - php_unit_fqcn_annotation - - phpdoc_indent - - phpdoc_inline_tag - - phpdoc_link_to_see - - phpdoc_no_access - - phpdoc_no_empty_return - - phpdoc_no_package - - phpdoc_no_useless_inheritdoc - - phpdoc_order - - phpdoc_property - - phpdoc_return_self_reference - - phpdoc_scalar - - phpdoc_separation - - phpdoc_summary - - phpdoc_to_comment - - phpdoc_trim - - phpdoc_type_to_var - - phpdoc_types - - phpdoc_types_order - - phpdoc_var_without_name - - property_separation - - self_accessor - - short_array_syntax - - short_list_syntax - - single_line_class_definition - - single_line_throw - - single_quote - - space_after_semicolon - - standardize_not_equals - - ternary_to_null_coalescing - - trailing_comma_in_multiline_array - - trim_array_spaces diff --git a/composer.json b/composer.json index 6ead683..24c7f4a 100644 --- a/composer.json +++ b/composer.json @@ -4,10 +4,10 @@ "license": "MIT", "type": "library", "keywords": [ - "last modified", - "not modified", + "last-modified", + "not-modified", "headers", - "304 http code", + "304-http-code", "304", "seo", "dragon-code", @@ -45,13 +45,13 @@ "require": { "php": "^8.0", "doctrine/dbal": "^2.6 || ^3.0", - "dragon-code/laravel-cache": "^3.0", + "dragon-code/laravel-cache": "^3.3", "dragon-code/simple-dto": "^2.3", "dragon-code/support": "^6.0", "fig/http-message-util": "^1.1", - "illuminate/console": "^6.0 || ^7.0 || ^8.0 || ^9.0", - "illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0", - "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/console": ">=6.0 <11.0", + "illuminate/database": ">=6.0 <11.0", + "illuminate/support": ">=6.0 <11.0", "lmc/http-constants": "^1.2", "nesbot/carbon": "^1.20 || ^2.0", "psr/http-message": "^1.0.1" @@ -59,8 +59,8 @@ "require-dev": { "ext-json": "*", "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0", - "phpunit/phpunit": "^9.0" + "orchestra/testbench": ">=4.0 <9.0", + "phpunit/phpunit": "^9.6" }, "conflict": { "andrey-helldar/last-modified": "*"