-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59fa602
commit 9bbe6b2
Showing
7 changed files
with
161 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Symfony | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
env: | ||
COMPOSER_NO_INTERACTION: 1 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 8.3 ] | ||
symfony: [ 2, 3, 4, 5, 6, 7 ] | ||
|
||
name: Symfony ${{ matrix.symfony }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: json, imagick | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Cache library packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-${{ hashFiles('composer.lock') }} | ||
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}- | ||
|
||
- name: Cache test packages | ||
id: composer-test-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: src/test/vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-test-${{ matrix.symfony }}-${{ hashFiles('src/test/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-symfony-test-${{ matrix.symfony }}- | ||
|
||
- name: Set Symfony version | ||
run: | | ||
composer require --no-update --no-interaction \ | ||
symfony/dependency-injection:^${{ matrix.symfony }} \ | ||
symfony/filesystem:^${{ matrix.symfony }} \ | ||
symfony/config:^${{ matrix.symfony }} | ||
- name: Upgrade PHPUnit | ||
if: matrix.php >= 7.2 | ||
run: cd src/test && composer require phpunit/phpunit:^5.7.27 --no-update --no-interaction --dev | ||
|
||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer update --prefer-dist --no-progress --prefer-stable --ignore-platform-req=php+ | ||
|
||
- name: Install test dependencies | ||
if: steps.composer-test-cache.outputs.cache-hit != 'true' | ||
run: cd src/test && composer update --prefer-dist --no-progress --prefer-stable --ignore-platform-req=php+ | ||
|
||
- name: Fix PHP compatibility | ||
if: steps.composer-test-cache.outputs.cache-hit != 'true' | ||
run: php src/test/php/fix-php-compatibility.php | ||
|
||
- name: Check Symfony version | ||
run: php src/test/symfony-version.php | ||
|
||
- name: Run test suite | ||
run: src/test/vendor/bin/phpunit -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
/*.xml | ||
composer.lock | ||
vendor | ||
src/test/vendor | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "phpmd/phpmd-tester", | ||
"license": "BSD-3-Clause", | ||
"type": "library", | ||
"require": { | ||
"php": ">=5.3.9", | ||
"phpunit/phpunit": "^4.8.36 || ^5.7.27" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
$installed = require __DIR__.'/../../vendor/composer/installed.php'; | ||
$versions = $installed['versions']; | ||
|
||
$symfonyPackages = array( | ||
'config', | ||
'dependency-injection', | ||
'filesystem', | ||
'yaml' | ||
); | ||
|
||
foreach ($symfonyPackages as $package) { | ||
echo "$package: ". | ||
(isset($versions['symfony/'.$package]['pretty_version']) | ||
? $versions['symfony/'.$package]['pretty_version'] | ||
: 'not installed'). | ||
"\n"; | ||
} |