Skip to content

Commit

Permalink
Merge pull request #8 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 61418ac + e8cb6e2 commit fc4781b
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 65 deletions.
45 changes: 23 additions & 22 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,30 +8,31 @@ on:

jobs:
phpstan:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- 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: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-8.1-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.1-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install
composer dump
- 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: Run analyse phpstan
run: vendor/bin/phpstan analyse --error-format github
19 changes: 11 additions & 8 deletions .github/workflows/fix_style.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
name: Fix Styles
name: Style fix

on:
push:
branches: [master]

jobs:
style:
style-fix:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.1-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-8.1
${{ 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
run: vendor/bin/php-cs-fixer fix

Expand Down
64 changes: 31 additions & 33 deletions .github/workflows/test.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: [8.2, 8.1, 8.0]
laravel: [10.*, 9.*]

name: PHP${{ matrix.php }}
php: [8.0, 8.1, 8.2, 8.3]

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- 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 }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
# if: steps.composer-cache.outputs.cache-hit != 'true'
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: composer test
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"prefer-stable": true,
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"phpunit/phpunit": "^9.3",
"phpunit/phpunit": "^9.3|^10.0|^10.5",
"phpstan/phpstan": "^1.2"
},
"autoload": {
Expand All @@ -37,4 +37,4 @@
"style": "vendor/bin/php-cs-fixer fix",
"analyse": "vendor/bin/phpstan analyse"
}
}
}

0 comments on commit fc4781b

Please sign in to comment.