Skip to content

Commit

Permalink
chore(tests): fix tests and add php 8 tests (#2)
Browse files Browse the repository at this point in the history
* chore: remove composer.lock

* fix(tests): update phpunit and add missing return type

* fix(phpstan): fix phpstan issues

* chore(tests): fix versions matrix

* style(php): fix lint

* chore(tests): add php 8 versions

* chore: update dev dependencies

* style(php): apply php cs fixer
  • Loading branch information
thislg authored Jul 1, 2024
1 parent d973b09 commit f5ef7ba
Show file tree
Hide file tree
Showing 20 changed files with 162 additions and 4,962 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ jobs:
build:
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']

runs-on: ubuntu-latest
container:
image: "lephare/php:${{ matrix.php_version }}"

steps:
- uses: actions/checkout@v2
Expand All @@ -23,9 +25,9 @@ jobs:
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php-${{ matrix.php_version }}-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ bin/
*.iml

composer.lock
.phpunit.result.cache
2 changes: 1 addition & 1 deletion .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
exit(0);
}

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
},
"require-dev": {
"php-http/guzzle6-adapter": "^1.0",
"friendsofphp/php-cs-fixer": "^2.16",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^0.12.50",
"phpunit/phpunit": "^7.5"
"phpunit/phpunit": "^8.5 || ^9.0",
"php-http/message-factory": "^1.1"
},
"autoload": {
"psr-4": {
Expand All @@ -46,10 +47,10 @@
"scripts": {
"analyse": "vendor/bin/phpstan analyse -c phpstan.neon",
"lint:fix": [
"vendor/bin/php-cs-fixer --config=.php_cs.dist --verbose fix src client tests"
"vendor/bin/php-cs-fixer --config=.php-cs-fixer.dist.php --verbose fix src client tests"
],
"lint:cs-fixer": [
"vendor/bin/php-cs-fixer --config=.php_cs.dist --dry-run --verbose --path-mode=intersection fix src client tests"
"vendor/bin/php-cs-fixer --config=.php-cs-fixer.dist.php --dry-run --verbose --path-mode=intersection fix src client tests"
],
"lint": [
"@analyse",
Expand Down
Loading

0 comments on commit f5ef7ba

Please sign in to comment.