Skip to content

Commit

Permalink
Improve CI (#8)
Browse files Browse the repository at this point in the history
* Improve CI

* Dont commit lock file

* Move to src

* Update autoload config

* cs fixes

* Fixed tests

* cs

* Dont use phpunit bridge

* fixed typo

* support phpunit8

* fix
  • Loading branch information
Nyholm authored Jul 15, 2021
1 parent bed00ee commit 6c719f6
Show file tree
Hide file tree
Showing 52 changed files with 281 additions and 1,208 deletions.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
/.github export-ignore
/.php_cs export-ignore
/.styleci.yml export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/Tests/ export-ignore
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [Nyholm]
2 changes: 2 additions & 0 deletions .github/workflows/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.yml]
indent_size = 2
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests
on: [ pull_request ]

jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
php: [ '7.2', '7.3', '7.4', '8.0' ]
sf_version: [ '4.4.*', '5.3.*' ]

steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
coverage: none
tools: flex

- name: Checkout code
uses: actions/checkout@v2

- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
uses: ramsey/composer-install@v1

- name: Run tests
run: ./vendor/bin/phpunit

lowest:
name: Lowest deps
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: 7.3
coverage: none

- name: Checkout code
uses: actions/checkout@v2

- name: Download dependencies
with:
dependency-versions: "lowest"
uses: ramsey/composer-install@v1

- name: Run tests
env:
SYMFONY_DEPRECATIONS_HELPER: "max[self]=0"
run: ./vendor/bin/phpunit
80 changes: 80 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
on: [pull_request]
name: Static analysis

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: phpstan:0.12.92, cs2pr

- name: Download dependencies
uses: ramsey/composer-install@v1

- name: PHPStan
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr

php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: php-cs-fixer:2.19.0, cs2pr

- name: PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

psalm:
name: Psalm
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: vimeo/psalm:4.8.1

- name: Download dependencies
uses: ramsey/composer-install@v1

- name: Psalm
run: psalm --no-progress --output-format=github

composer-normalize:
name: Composer Normalize
runs-on: ubuntu-20.04

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: composer-normalize

- name: Checkout code
uses: actions/checkout@v2

- name: Normalize
run: composer-normalize --dry-run
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/php_cs.cache
/composer.lock
/phpunit.xml
/vendor/
.php_cs.cache
.phpunit.result.cache
composer.lock
phpunit.xml
vendor/
3 changes: 1 addition & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $finder = PhpCsFixer\Finder::create()
return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder)
;
;
9 changes: 0 additions & 9 deletions .scrutinizer.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .styleci.yml

This file was deleted.

64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

Empty file removed Tests/.gitignore
Empty file.
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": "^7.1.3",
"php": ">=7.2",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"symfony/config": "^4.1",
"symfony/contracts": "^1.0.2",
"symfony/dependency-injection": "^4.1",
"symfony/framework-bundle": "^4.1",
"symfony/http-kernel": "^4.1",
"twig/twig": "^2.0"
"symfony/config": "^4.4 || ^5.3 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0",
"twig/twig": "^2.14 || ^3.3"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"symfony/phpunit-bridge": "^4.1"
},
"config": {
"sort-packages": true
"phpunit/phpunit": "^8.5 || ^9.5"
},
"autoload": {
"psr-4": {
"Happyr\\WordpressBundle\\": ""
"Happyr\\WordpressBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Happyr\\WordpressBundle\\Tests\\": "tests/"
}
}
}
Loading

0 comments on commit 6c719f6

Please sign in to comment.