From 00670e030289cbcbb73c1049cad4211735029147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Llorens?= Date: Tue, 16 Apr 2024 10:44:21 +0200 Subject: [PATCH 1/3] Add Support to Laravel 11 --- .github/workflows/fix_style.yml | 21 +++++++++---- .github/workflows/test.yml | 53 +++++++++++++++++++-------------- composer.json | 8 +++-- 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/.github/workflows/fix_style.yml b/.github/workflows/fix_style.yml index 1d37dac..7503457 100644 --- a/.github/workflows/fix_style.yml +++ b/.github/workflows/fix_style.yml @@ -1,24 +1,35 @@ -name: Fix Styles +name: Style fix on: push: branches: [master] jobs: - style: + style-fix: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + 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 + composer install --no-interaction --no-progress composer dump - name: Fix styles diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98c8888..67f61c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: tests +name: Tests on: push: @@ -8,30 +8,39 @@ on: jobs: phpunit: - runs-on: ubuntu-latest strategy: + fail-fast: true matrix: - php: [8.3, 8.2, 8.1, 8.0] - - name: PHP${{ matrix.php }} + php: [8.0, 8.1, 8.2, 8.3] steps: - - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: | - composer install - composer dump - - - name: Run test phpunit - run: composer test + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - 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 }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer install --no-interaction --no-progress + composer dump + + - name: Run test phpunit + run: vendor/bin/phpunit --stop-on-error --stop-on-failure diff --git a/composer.json b/composer.json index 4102a6c..dce096a 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,9 @@ "name": "descom/dev", "description": "Package to PHP Developer projects in Descom.es", "type": "library", - "keywords": ["dev"], + "keywords": [ + "dev" + ], "require": { "php": "^8.0" }, @@ -24,7 +26,7 @@ "prefer-stable": true, "require-dev": { "friendsofphp/php-cs-fixer": "^3.35", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5|^10.0|^10.5" }, "autoload": { "psr-4": { @@ -38,4 +40,4 @@ "suggest": { "friendsofphp/php-cs-fixer": "Required to apply styles" } -} +} \ No newline at end of file From aa457b68fb397a546b97ac2454b0dab4826aa638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Llorens?= Date: Tue, 16 Apr 2024 10:45:02 +0200 Subject: [PATCH 2/3] Add Support to Laravel 11 --- .github/workflows/analyse.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/analyse.yml diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml new file mode 100644 index 0000000..70354f8 --- /dev/null +++ b/.github/workflows/analyse.yml @@ -0,0 +1,38 @@ +name: Analyse + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + phpstan: + runs-on: ubuntu-latest + + steps: + - 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 From 2e9461b56db8bcc14ad9646afc11c54341051e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Llorens?= Date: Tue, 16 Apr 2024 10:47:52 +0200 Subject: [PATCH 3/3] Add Support to Laravel 11 --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dce096a..1f1d282 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,8 @@ "prefer-stable": true, "require-dev": { "friendsofphp/php-cs-fixer": "^3.35", - "phpunit/phpunit": "^9.5|^10.0|^10.5" + "phpunit/phpunit": "^9.5|^10.0|^10.5", + "phpstan/phpstan": "^1.8" }, "autoload": { "psr-4": {