Skip to content

Commit

Permalink
[Cleanup] Fix CI processes, update legacy files (#28)
Browse files Browse the repository at this point in the history
* Various CI fixes and updates
* Ignore macOS hidden folder files
* Fix dependencies versions
* Fix linting
* Use correct PHPUnit version
  • Loading branch information
tchapi authored Jan 13, 2022
1 parent ff1c9f3 commit 8932b9f
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 27 deletions.
26 changes: 16 additions & 10 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: 9
SYMFONY_PHPUNIT_VERSION: 9.5
SYMFONY_DEPRECATIONS_HELPER: max[self]=0

jobs:
Expand All @@ -21,8 +21,6 @@ jobs:
uses: actions/checkout@v2
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Update Composer v2
run: composer self-update --preview
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down Expand Up @@ -59,20 +57,28 @@ jobs:
php:
- '7.3'
- '7.4'
- '8.0-rc'
- '8.0'
- '8.1'
dependencies:
- 'highest'
include:
- php: '7.2'
dependencies: 'lowest'
- php: '7.2'
dependencies: 'lowest'
phpunit-version: 8.5
- php: '7.3'
phpunit-version: 9.5
- php: '7.4'
phpunit-version: 9.5
- php: '8.0'
phpunit-version: 9.5
- php: '8.1'
phpunit-version: 9.5
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
# - name: Update Composer v2
# run: composer self-update --preview
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -94,6 +100,8 @@ jobs:
if: matrix.dependencies == 'highest'
run: composer update --no-progress --no-suggest --ansi
- name: Run tests with PHPUnit
env:
SYMFONY_PHPUNIT_VERSION: ${{ matrix.phpunit-version }}
run: vendor/bin/simple-phpunit --colors=always

coverage:
Expand All @@ -114,8 +122,6 @@ jobs:
docker-php-ext-enable pcov
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Update Composer v2
run: composer self-update --preview
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.php_cs.cache
.php-cs-fixer.cache
psalm-phpqa.xml
.phpunit.result.cache
composer.lock
vendor/*

.DS_Store
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Automate form building.

| Branch | Tools |
| --- | --- |
| master | [![Build Status][ci_badge]][ci_link] [![Coverage Status][coverage_badge]][coverage_link] [![SensioLabsInsight][sensioinsight_badge]][sensioinsight_link] |
| master | [![Build Status][ci_badge]][ci_link] [![Coverage Status][coverage_badge]][coverage_link] |

## Documentation

Expand All @@ -34,5 +34,3 @@ This package is available under the [MIT license](LICENSE).
[ci_link]: https://github.com/a2lix/AutoFormBundle/actions?query=workflow%3ACI
[coverage_badge]: https://codecov.io/gh/a2lix/AutoFormBundle/branch/master/graph/badge.svg
[coverage_link]: https://codecov.io/gh/a2lix/AutoFormBundle/branch/master
[sensioinsight_badge]: https://insight.sensiolabs.com/projects/c6e68536-570e-409b-99c0-528c3484ada7/mini.png
[sensioinsight_link]: https://insight.sensiolabs.com/projects/c6e68536-570e-409b-99c0-528c3484ada7
19 changes: 11 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
},
"require-dev": {
"doctrine/orm": "^2.7",
"edgedesign/phpqa": "^1.23.3",
"friendsofphp/php-cs-fixer": "^2.15",
"phpstan/phpstan": "^0.12",
"sensiolabs/security-checker": "^6.0",
"symfony/phpunit-bridge": "^4.3|^5.0",
"symfony/validator": "^3.4.30|^4.3|^5.0",
"vimeo/psalm": "^3.6"
"edgedesign/phpqa": "^1.25",
"friendsofphp/php-cs-fixer": "^3.4.0",
"phpstan/phpstan": "^1.2.0",
"symfony/cache": "^5.4",
"symfony/phpunit-bridge": "^6.0",
"vimeo/psalm": "^4.15"
},
"suggest": {
"a2lix/translation-form-bundle": "For translation form"
Expand All @@ -45,11 +45,14 @@
"psalm"
],
"phpunit": [
"SYMFONY_PHPUNIT_VERSION=9 SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 simple-phpunit"
"SYMFONY_PHPUNIT_VERSION=9.5 SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 simple-phpunit"
]
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true
}
},
"autoload": {
"psr-4": { "A2lix\\AutoFormBundle\\": "src/" }
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/AutoFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function configureOptions(OptionsResolver $resolver): void

$resolver->setNormalizer('data_class', function (Options $options, $value): string {
if (empty($value)) {
throw new \RuntimeException(sprintf('Missing "data_class" option of "AutoFormType".'));
throw new \RuntimeException('Missing "data_class" option of "AutoFormType".');
}

return $value;
Expand Down

0 comments on commit 8932b9f

Please sign in to comment.