Skip to content

Commit

Permalink
Merge pull request #12 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 c3a8063 + 4783e10 commit 530b0d5
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 102 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: analyze
name: Analyse

on:
push:
Expand All @@ -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
68 changes: 32 additions & 36 deletions .github/workflows/style_fix.yml
Original file line number Diff line number Diff line change
@@ -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
79 changes: 44 additions & 35 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,49 +8,58 @@ on:

jobs:
phpunit:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php-versions: ['8.2', '8.1', '8.0']
laravel: [9.*, 10.*]
php: [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: 10.*
php: 8.0
- laravel: 9.*
php: 8.3
- 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
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"descom/descommarket_common": "^1.2",
"descom/pipeline": "^2.2",
"google/apiclient": "^2.12.1",
"illuminate/console": "*",
"illuminate/database": "*",
"laravel/framework": "^9.0|^10.0"
"laravel/framework": "^9.0|^10.0|^11.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"guzzlehttp/guzzle": "^7.5",
"larastan/larastan": "^2.8",
"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": {
Expand All @@ -51,4 +51,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}

0 comments on commit 530b0d5

Please sign in to comment.