Skip to content

Commit

Permalink
Update PHPUnit to v11 & PHP to v8.3 (#143)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gomzyakov <alexander.gomzyakov@gmail.com>
  • Loading branch information
renovate[bot] and gomzyakov committed Apr 13, 2024
1 parent 8359c81 commit 041a9e4
Show file tree
Hide file tree
Showing 11 changed files with 3,696 additions and 97 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PHP CS Fixer

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
check:
name: Check
runs-on: ubuntu-latest

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

- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Run checks of code style
run: composer cs-check
27 changes: 27 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PHPStan

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

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

- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: Install Composer dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Run tests via PHPStan
run: composer phpstan
50 changes: 50 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: PHPUnit

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: Test & Upload coverage.xml to Codecov
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, pdo, sqlite, pdo_sqlite
ini-values: max_execution_time=180

- name: Install PHP extensions
run: sudo apt-get install -y php-phpdbg

- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Run tests via PHPUnit
env:
XDEBUG_MODE: coverage
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml
cat ./coverage.xml
- name: Show coverage.xml
run: cat ./coverage.xml

- name: Upload coverage.xml to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
verbose: true
env_vars: PHP
81 changes: 0 additions & 81 deletions .github/workflows/tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# Composer
/vendor
composer.lock

# phpunit
.phpunit.cache
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.3",
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.53",
"phpunit/phpunit": "^10.5",
"phpunit/phpunit": "^11.0",
"phpstan/phpstan": "^1.10",
"mockery/mockery": "^1.6"
},
Expand Down
Loading

0 comments on commit 041a9e4

Please sign in to comment.