Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto

/.github export-ignore
/Tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
119 changes: 53 additions & 66 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,58 @@
name: "CI Tests"

on:
pull_request:
push:
pull_request:
push:

jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.can-fail }}
strategy:
fail-fast: false
matrix:
include:
# Lowest Deps
- php: 7.1
symfony: 4.4.*
composer-flags: '--prefer-stable --prefer-lowest'
can-fail: false
# LTS with latest stable PHP
- php: 8.1
symfony: 5.4.*
composer-flags: '--prefer-stable'
can-fail: false
# Stable Symfony branches
- php: 7.4
symfony: 4.4.*
composer-flags: '--prefer-stable'
can-fail: false
- php: 8.0
symfony: 6.0.*
composer-flags: '--prefer-stable'
can-fail: false
# Development Symfony branches
- php: 8.1
symfony: 6.1.*@dev
composer-flags: ''
can-fail: false

name: "PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Cache Composer packages"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}"
restore-keys: "php-"
env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
SYMFONY_DEPRECATIONS_HELPER: weak

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
tools: "composer:v2,flex"

- name: "Set Composer stability"
if: "matrix.symfony == '6.1.*@dev'"
run: "composer config minimum-stability dev"

- name: "Install dependencies"
run: "composer update ${{ matrix.composer-flags }} --prefer-dist"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"

- name: "Run PHPUnit Tests"
run: "composer test"
jobs:
build:
runs-on: ubuntu-latest
name: PHP v${{ matrix.php }}, Symfony v${{ matrix.symfony }}
strategy:
fail-fast: false
matrix:
include:
- { php: 8.2, symfony: "6.4.*", composer-flags: '--prefer-dist' } # Lowest deps
- { php: 8.3, symfony: "6.4.*", composer-flags: '--prefer-dist' } # LTS with last stable PHP
- { php: 8.3, symfony: "7.1.*", composer-flags: '--prefer-dist' } # Stable Symfony branches
- { php: 8.4, symfony: "7.2.*", composer-flags: '--prefer-dist' } # Stable Symfony branches

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl,mbstring,xdebug
ini-values: date.timezone="Europe/Paris"
coverage: xdebug
tools: "composer:v2,flex"

- name: "Show PHP version"
run: php -v && composer -V

- name: "Cache Composer packages"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}"
restore-keys: "php-"

- name: "Install dependencies"
run: |
perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json
composer update ${{ matrix.composer-flags }} --prefer-dist
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"

- name: "Run PHPUnit Tests"
run: "composer test"
25 changes: 11 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"license": "MIT",
"authors": [
{
"name": "Dev Choosit",
"email": "dev@choosit.com"
"name": "Dev Spiriit",
"email": "dev@spiriit.com"
}
],
"require": {
"php": ">=7.1",
"symfony/http-client": "^4.4|^5.4|^6.0",
"php": "^8.1",
"ext-dom": "*",
"symfony/serializer": "^4.4|^5.4|^6.0"
"symfony/http-client": "^5.4|^6.4|^7.0",
"symfony/serializer": "^5.4|^6.4|^7.0"
},
"autoload": {
"psr-4": {
Expand All @@ -27,18 +27,15 @@
}
},
"require-dev": {
"symfony/yaml": "^4.4|^5.4|^6.0",
"symfony/phpunit-bridge": "^4.4|^5.1|^6.0",
"symfony/yaml": "^5.4|^6.4|^7.0",
"friendsofphp/php-cs-fixer": "*",
"symfony/framework-bundle": "^4.4|^5.4|^6.0",
"symfony/phpunit-bridge": "^5.4|^6.4|^7.0",
"symfony/framework-bundle": "^5.4|^6.4|^7.0",
"phpstan/phpstan": "*",
"rector/rector": "^2.0",
"ekino/phpstan-banned-code": "*",
"vimeo/psalm": "*",
"psalm/plugin-symfony": "*",
"infection/infection": "*"
},
"conflict": {
"symfony/framework-bundle": "<4.4"
"infection/infection": "*",
"symplify/easy-coding-standard": "^12.5"
},
"scripts": {
"test": [
Expand Down
34 changes: 34 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

/*
* This file is part of the composer-write-changelogs project.
*
* (c) Dev Spiriit <dev@spiriit.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $config): void {
$config->sets([SetList::PSR_12]);
$config->rule(OrderedImportsFixer::class);
$config->ruleWithConfiguration(ArraySyntaxFixer::class, [
'syntax' => 'short',
]);

$config->parallel();
$config->paths([__DIR__]);
$config->skip([
__DIR__ . '/.github',
__DIR__ . '/vendor',
PhpdocScalarFixer::class
]);
};
31 changes: 18 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
executionOrder="random"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
convertDeprecationsToExceptions="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory>src/</directory>
<directory>./</directory>
</include>
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>

<testsuites>
Expand All @@ -24,7 +30,6 @@
</testsuites>

<php>
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5"/>
<env name="KERNEL_CLASS" value="Choosit\ModeloBundle\Tests\Integration\Kernel"/>
<env name="SYMFONY_DECRYPTION_SECRET" value="$_test"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
Expand Down
66 changes: 0 additions & 66 deletions psalm.xml

This file was deleted.

35 changes: 35 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

/*
* This file is part of the composer-write-changelogs project.
*
* (c) Dev Spiriit <dev@spiriit.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;
use Rector\ValueObject\PhpVersion;

return RectorConfig::configure()
->withSkip([
__DIR__ . '/.github',
__DIR__ . '/DependencyInjection/Configuration.php',
__DIR__ . '/vendor',
])
->withPaths([
__DIR__
])
->withPhpVersion(PhpVersion::PHP_84)
->withSets([SetList::PHP_84])
->withImportNames()
->withPreparedSets(
deadCode: true,
typeDeclarations: true,
privatization: true,
earlyReturn: true
);
Loading