Skip to content

Commit

Permalink
Merge branch 1.6.x into main (#1289)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jun 29, 2023
2 parents f70b148 + 263b151 commit c322a33
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 169 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,34 @@ on:
push:
branches:
- "[0-9]+.[0-9]+.x"
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1']
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up php 8.1
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: ${{ matrix.php }}
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
tools: composer:v2
extensions: mongodb, redis

- name: Install dependencies
run: composer self-update && composer install && composer dump-autoload
- name: Install locked dependencies
uses: ramsey/composer-install@v2

- name: Run tests and collect coverage
run: composer phpunit
- name: Run PHPUnit to collect coverage
run: composer phpunit:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ github.workspace }}/.cache/phpunit/
verbose: true
5 changes: 3 additions & 2 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: xdebug
coverage: pcov
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On

- name: Install dependencies
run: composer install
uses: ramsey/composer-install@v2

- name: Run Psalm
run: composer psalm
29 changes: 11 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ on:

jobs:
phpunit:
name: PHPUnit on PHP ${{ matrix.php }}
name: PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.dependencies }} Dependencies
runs-on: ubuntu-latest

strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
dependencies: ['lowest','highest','locked']
dev: ['8.3']

continue-on-error: ${{ matrix.php == matrix.dev }}
Expand All @@ -28,29 +29,21 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
tools: composer:v2
extensions: mongodb, redis
coverage: xdebug
coverage: pcov

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup Problem Matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Dependencies
if: ${{ matrix.php != matrix.dev }}
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Install Dependencies (ignore platform php:${{ matrix.dev }})
if: ${{ matrix.php == matrix.dev }}
uses: nick-invision/retry@v2
- name: Install ${{ matrix.dependencies }} Dependencies
uses: ramsey/composer-install@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress --ignore-platform-req=php
dependency-versions: ${{ matrix.dependencies }}

- name: Execute PHPUnit
run: vendor/bin/phpunit
run: composer phpunit
38 changes: 17 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.3",
"psalm/plugin-phpunit": "^0.18",
"vimeo/psalm": "^5.12"
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.13.1"
},
"conflict": {
"phpunit/phpunit": "<8.0"
Expand All @@ -58,7 +58,10 @@
]
},
"config": {
"preferred-install": "dist"
"preferred-install": "dist",
"platform": {
"php": "7.4.999"
}
},
"extra": {
"branch-alias": {
Expand All @@ -68,30 +71,23 @@
"scripts": {
"check": [
"@composer validate",
"@test",
"@psalm:security",
"@psalm:dry-run"
],
"docs": "phpdoc -d library -t docs/api",
"phpunit": [
"@xdebug",
"vendor/bin/phpunit --colors=always --testdox --stop-on-failure"
"@test"
],
"docs": "vendor/bin/phpdoc -d library -t docs/api",
"phpunit": "vendor/bin/phpunit --colors=always --testdox --stop-on-failure",
"phpunit:coverage": "vendor/bin/phpunit --colors=always --testdox --stop-on-failure --coverage-clover=coverage.xml",
"psalm": [
"@xdebug",
"@psalm:shepherd"
"@psalm:shepherd",
"@psalm:security",
"@psalm:dry-run"
],
"psalm:baseline": "vendor/bin/psalm --set-baseline=psalm-baseline.xml",
"psalm:dry-run": "vendor/bin/psalm --alter --issues=all --dry-run",
"psalm:missing": "vendor/bin/psalm --alter --issues=MissingReturnType",
"psalm:security": "vendor/bin/psalm --taint-analysis",
"psalm:shepherd": "vendor/bin/psalm --shepherd --show-info=false --stats --no-diff --no-cache",
"psalm:baseline": "vendor/bin/psalm --no-diff --no-cache --set-baseline=psalm-baseline.xml",
"psalm:dry-run": "vendor/bin/psalm --no-cache --alter --issues=all --dry-run",
"psalm:security": "vendor/bin/psalm --no-diff --no-cache --taint-analysis",
"psalm:shepherd": "vendor/bin/psalm --no-diff --no-cache --shepherd --stats --output-format=github",
"test": [
"@phpunit",
"@psalm"
],
"xdebug": [
"@putenv XDEBUG_MODE=coverage"
]
}
}

0 comments on commit c322a33

Please sign in to comment.