Skip to content

Commit

Permalink
Merge pull request #213 from norkunas/sf7
Browse files Browse the repository at this point in the history
Allow Symfony 7
  • Loading branch information
norkunas authored Nov 28, 2023
2 parents 02ec642 + 2e5e294 commit 4c2fee7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ on:
branches:
- "master"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
fail-fast: true

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
Expand All @@ -33,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -64,31 +71,34 @@ jobs:
symfony-version: 6.2.*
- php-version: 8.2
symfony-version: 6.3.*
- php-version: 8.2
symfony-version: 6.4.*
- php-version: 8.2
symfony-version: 7.0.*
- php-version: 8.3
symfony-version: 7.0.*
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: flex

- name: "Get composer cache directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Change stability"
if: matrix.symfony-version == '6.4.*' || matrix.symfony-version == '7.0.*'
run: |
composer config minimum-stability "dev"
composer config prefer-stable false
- name: "Cache dependencies"
uses: actions/cache@v3
- name: "Install Dependencies with Composer"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: "Install dependencies with composer"
run: |
composer require symfony/filesystem:${{ matrix.symfony-version }} symfony/process:${{ matrix.symfony-version }} --no-interaction --no-update
composer update --no-interaction --no-progress --no-suggest
composer-options: "--optimize-autoloader"

- name: "Run tests with PHPUnit"
env:
Expand All @@ -100,7 +110,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

$finder = (new PhpCsFixer\Finder())
->files()
->name('*.php')
->in(__DIR__ . '/src');

return (new PhpCsFixer\Config())
Expand All @@ -26,5 +25,6 @@
'static_lambda' => true,
'align_multiline_comment' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'no_superfluous_phpdoc_tags' => false,
])
->setFinder($finder);
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"require": {
"php": ">=7.4.0",
"ext-json": "*",
"symfony/filesystem": "^4.4|^5.1|^6.0",
"symfony/filesystem": "^4.4|^5.1|^6.0|^7.0",
"symfony/polyfill-php80": "^1.26",
"symfony/process": "^4.4|^5.1|^6.0"
"symfony/process": "^4.4|^5.1|^6.0|^7.0"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.11",
"php-cs-fixer/shim": "^3.23",
"phpstan/phpstan": "^1.10.32",
"phpstan/phpstan-phpunit": "^1.3.13",
"php-cs-fixer/shim": "^3.40",
"phpstan/phpstan": "^1.10.45",
"phpstan/phpstan-phpunit": "^1.3.15",
"symfony/phpunit-bridge": "^6.3.2"
},
"autoload": {
Expand Down

0 comments on commit 4c2fee7

Please sign in to comment.