Skip to content

Commit

Permalink
Merge pull request #7 from descom-es/laravel_11_tests
Browse files Browse the repository at this point in the history
Add Support to Laravel 11
  • Loading branch information
llorensjj authored Apr 18, 2024
2 parents 2cb20d6 + a0218c7 commit 1d2a4f4
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 99 deletions.
55 changes: 26 additions & 29 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: analyse
name: Analyse

on:
push:
Expand All @@ -8,34 +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: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-8.1
- name: Install dependencies
if: steps.cache-descom-laravel-auth.outputs.cache-hit != 'true'
run: |
composer install
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
67 changes: 32 additions & 35 deletions .github/workflows/style-fix.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
name: style-fix
name: Style fix

on:
push:
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

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-8.1
- name: Install dependencies
if: steps.cache-descom-laravel-auth.outputs.cache-hit != 'true'
run: |
composer install
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
64 changes: 31 additions & 33 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tests
name: Tests

on:
push:
Expand All @@ -8,41 +8,39 @@ on:

jobs:
phpunit:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php-versions: ['8.2', '8.1', '8.0']
php: [8.1, 8.2, 8.3]

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, exif
coverage: xdebug


- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install
composer dump
- 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 }}

- 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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require-dev": {
"guzzlehttp/psr7": "^1",
"omnipay/tests": "^4.1",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5|^10.0|^10.5",
"friendsofphp/php-cs-fixer": "^3.10",
"phpstan/phpstan": "^1.8"
},
Expand All @@ -40,4 +40,4 @@
"php-http/discovery": false
}
}
}
}

0 comments on commit 1d2a4f4

Please sign in to comment.