Skip to content

Commit

Permalink
Make compatible with Symfony 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCarden committed Apr 2, 2024
1 parent 6f4b508 commit ce3cd1e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 35 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.1"
php-version: "8.2"
coverage: none

- name: "Checkout code"
Expand All @@ -41,28 +41,28 @@ jobs:
run: "composer static"

tests:
name: "Test: ${{ matrix.os }} / deps-${{ matrix.dependencies }}"
runs-on: "${{ matrix.os }}"
name: "Test: ${{ matrix.os }} / ${{ matrix.php }} / ${{ matrix.dependencies }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
php: [ "8.1" ]
os: [ ubuntu, macos, windows ]
php: [ "8.1", "8.2" ]
dependencies: [ lowest, highest ]
steps:
- name: "Install rsync"
uses: GuillaumeFalourd/[email protected] # https://github.com/marketplace/actions/setup-rsync

- name: "Set up PHP w/ Coverage"
if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }}
if: ${{ matrix.os == 'ubuntu' && matrix.dependencies == 'highest' }}
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "${{ matrix.php }}"
extensions: gd
ini-values: assert.active=1, assert.exception=1, zend.assertions=1

- name: "Set up PHP w/o Coverage"
if: ${{ !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }}
if: ${{ !( matrix.os == 'ubuntu' && matrix.dependencies == 'highest' ) }}
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "${{ matrix.php }}"
Expand All @@ -85,33 +85,32 @@ jobs:

- name: "Run core tests with coverage"
run: "composer test"
if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }}
if: ${{ matrix.os == 'ubuntu' && matrix.dependencies == 'highest' }}

# There's no reason to generate coverage data on multiple jobs--the result should be the same.
- name: "Run core tests without coverage"
run: "./vendor/bin/phpunit --no-coverage --exclude-group=windows_only"
if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }}
if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu' && matrix.dependencies == 'highest' ) }}

- name: "Run Windows tests"
run: "./vendor/bin/phpunit --no-coverage --exclude-group=no_windows"
if: ${{ runner.os == 'Windows' }}

performance:
name: "Performance: ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
php: [ "8.1" ]
os: [ ubuntu, windows ]
steps:
- name: "Install rsync"
uses: GuillaumeFalourd/[email protected] # https://github.com/marketplace/actions/setup-rsync

- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.1"
php-version: "8.2"
coverage: none

- name: "Checkout code"
Expand All @@ -130,7 +129,7 @@ jobs:
- name: "Set up PHP"
uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action
with:
php-version: "8.1"
php-version: "8.2"
extensions: gd
ini-values: assert.active=1, assert.exception=1, zend.assertions=1

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"require": {
"php": ">=8.1.0",
"ext-json": "*",
"symfony/filesystem": "^6.2",
"symfony/process": "^6.2",
"symfony/filesystem": "^6.2 || ^7.0",
"symfony/process": "^6.2 || ^7.0",
"symfony/translation-contracts": "^3.1"
},
"require-dev": {
Expand Down
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions tests/Finder/Service/ExecutableFinderUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public function testFind(): void
$command = 'command_name';
$this->symfonyExecutableFinder
->addSuffix('.phar')
->shouldBeCalled()
->willReturn(null);
->shouldBeCalled();
$this->symfonyExecutableFinder
->find($command)
->shouldBeCalledOnce()
Expand All @@ -60,8 +59,7 @@ public function testFindNotFound(): void
$command = 'command_name';
$this->symfonyExecutableFinder
->addSuffix('.phar')
->shouldBeCalledOnce()
->willReturn(null);
->shouldBeCalledOnce();
$this->symfonyExecutableFinder
->find($command)
->shouldBeCalledOnce()
Expand Down

0 comments on commit ce3cd1e

Please sign in to comment.