Skip to content

Commit

Permalink
Fix CI/CD (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi authored Dec 14, 2021
1 parent adb5e5b commit 880f9ae
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 20 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: ["push", "pull_request"]

env:
COMPOSER_ALLOW_SUPERUSER: '1'
SYMFONY_PHPUNIT_VERSION: 8.5
SYMFONY_PHPUNIT_VERSION: 9.5
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: 1
SYMFONY_DEPRECATIONS_HELPER: max[self]=0

Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
apk add $PHPIZE_DEPS libxslt-dev
docker-php-ext-install xsl
- name: Install highest dependencies with Composer
run: composer update --no-progress --no-suggest --ansi
run: composer update --no-progress --ansi
- name: Disable PHP memory limit
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
- name: Analyze
Expand All @@ -60,6 +60,13 @@ jobs:
dependencies:
- lowest
- highest
include:
- php: '7.2'
phpunit-version: 8.5
- php: '7.3'
phpunit-version: 9.5
- php: '7.4'
phpunit-version: 9.5
fail-fast: false
steps:
- name: Checkout
Expand All @@ -80,11 +87,13 @@ jobs:
docker-php-ext-install xsl
- name: Install lowest dependencies with Composer
if: matrix.dependencies == 'lowest'
run: composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
run: composer update --no-progress --prefer-stable --prefer-lowest --ansi
- name: Install highest dependencies with Composer
if: matrix.dependencies == 'highest'
run: composer update --no-progress --no-suggest --ansi
run: composer update --no-progress --ansi
- name: Run tests with PHPUnit
env:
SYMFONY_PHPUNIT_VERSION: ${{ matrix.phpunit-version }}
run: vendor/bin/simple-phpunit --colors=always

coverage:
Expand Down Expand Up @@ -122,7 +131,7 @@ jobs:
apk add $PHPIZE_DEPS libxslt-dev
docker-php-ext-install xsl
- name: Install highest dependencies with Composer
run: composer update --no-progress --no-suggest --ansi
run: composer update --no-progress --ansi
- name: Run coverage with PHPUnit
run: vendor/bin/simple-phpunit --coverage-clover ./coverage.xml --colors=always
- name: Send code coverage report to Codecov.io
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.php_cs.cache
.php-cs-fixer.cache
psalm-phpqa.xml
.phpunit.result.cache
composer.lock
vendor/*
vendor/*
4 changes: 2 additions & 2 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
file that was distributed with this source code.
HEADER;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
Expand All @@ -34,7 +34,7 @@
'php_unit_test_class_requires_covers' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
(new PhpCsFixer\Finder())
->exclude(['vendor'])
->in(['src', 'tests'])
)
Expand Down
6 changes: 4 additions & 2 deletions .phpqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ phpqa:
- php-cs-fixer:0
- phpunit:0
- psalm
- security-checker:0
output: cli

phpunit:
binary: ./vendor/bin/simple-phpunit

php-cs-fixer:
config: .php_cs.dist
config: .php-cs-fixer.dist.php

psalm:
config: psalm.xml
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ This package is available under the [MIT license](LICENSE).
[v3_ci_link]: https://github.com/a2lix/TranslationFormBundle/actions?query=workflow%3ACI
[v3_coverage_badge]: https://codecov.io/gh/a2lix/TranslationFormBundle/branch/master/graph/badge.svg
[v3_coverage_link]: https://codecov.io/gh/a2lix/TranslationFormBundle/branch/master
[v3_sensioinsight_badge]: https://insight.sensiolabs.com/projects/64aee70e-7b00-406f-8648-f7ea66e29f80/mini.png
[v3_sensioinsight_link]: https://insight.sensiolabs.com/projects/64aee70e-7b00-406f-8648-f7ea66e29f80
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
"require-dev": {
"doctrine/orm": "^2.7",
"edgedesign/phpqa": "^1.23",
"friendsofphp/php-cs-fixer": "^2.15",
"friendsofphp/php-cs-fixer": "^3.4.0",
"knplabs/doctrine-behaviors": "^1.6",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"phpstan/phpstan": "^0.11.19",
"sensiolabs/security-checker": "^6.0",
"symfony/phpunit-bridge": "^4.3|^5.0",
"phpstan/phpstan": "^1.2.0",
"symfony/cache": "^5.4",
"symfony/phpunit-bridge": "^6.0",
"symfony/validator": "^3.4.30|^4.3|^5.0",
"vimeo/psalm": "^3.6"
"vimeo/psalm": "^4.15"
},
"suggest": {
"knplabs/doctrine-behaviors": "For Knp strategy",
Expand All @@ -61,7 +61,7 @@
"psalm"
],
"phpunit": [
"SYMFONY_DEPRECATIONS_HELPER=max[self]=0 SYMFONY_PHPUNIT_VERSION=8.5 SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 simple-phpunit"
"SYMFONY_DEPRECATIONS_HELPER=max[self]=0 SYMFONY_PHPUNIT_VERSION=9.5 SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 simple-phpunit"
]
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />
<MisplacedRequiredParam errorLevel="info" />
<!-- <MisplacedRequiredParam errorLevel="info" /> -->

<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/TranslationsFormsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function configureOptions(OptionsResolver $resolver): void
$resolver->setNormalizer('form_options', function (Options $options, $value): array {
// Check mandatory data_class option when AutoFormType use
if (($options['form_type'] instanceof AutoFormType) && !isset($value['data_class'])) {
throw new \RuntimeException(sprintf('Missing "data_class" option under "form_options" of TranslationsFormsType. Required when "form_type" use "AutoFormType".'));
throw new \RuntimeException('Missing "data_class" option under "form_options" of TranslationsFormsType. Required when "form_type" use "AutoFormType".');
}

return $value;
Expand Down

0 comments on commit 880f9ae

Please sign in to comment.