Skip to content

Commit

Permalink
Merge branch 'master' into split-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz authored Jul 9, 2023
2 parents 2553d3b + 25c1e46 commit d3787c1
Show file tree
Hide file tree
Showing 13 changed files with 240 additions and 146 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/db-mariadb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

name: db-mariadb

jobs:
tests:
name: PHP ${{ matrix.php }}-mariadb-${{ matrix.mariadb }}

env:
COMPOSER_ROOT_VERSION: 1.0.0
CURRENT_PACKAGE: db-mysql
EXTENSIONS: pdo, pdo_mysql

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.0
- 8.1
- 8.2

mariadb:
- mariadb:10.4
- mariadb:10.5
- mariadb:10.6
- mariadb:10.7
- mariadb:10.8
- mariadb:10.9
- mariadb:latest

services:
mysql:
image: ${{ matrix.mariadb }}
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true
MARIADB_ROOT_PASSWORD: ''
MARIADB_DATABASE: yiitest
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout.
uses: actions/checkout@v3

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
coverage: pcov

- name: Update composer.
run: composer self-update

- name: Set environment variables pull request linux.
uses: yiisoft/actions/db/environment-linux@master

- name: Install db.
uses: yiisoft/actions/db/subpackage-install@master
with:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
CURRENT_PACKAGE: ${{ env.CURRENT_PACKAGE }}
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}

- name: Run Mysql tests with phpunit and code coverage.
run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
9 changes: 1 addition & 8 deletions .github/workflows/db-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ jobs:
mysql:
- mysql:5.7
- mysql:latest
- mariadb:10.4
- mariadb:10.5
- mariadb:10.6
- mariadb:10.7
- mariadb:10.8
- mariadb:10.9
- mariadb:latest

services:
mysql:
Expand Down Expand Up @@ -91,7 +84,7 @@ jobs:
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}

- name: Run Mssql tests with phpunit and code coverage.
- name: Run Mysql tests with phpunit and code coverage.
run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/rector.yml_ → .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,13 @@ on:
- 'infection.json.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

name: rector

jobs:
rector:
uses: yiisoft/actions/.github/workflows/rector.yml@master
secrets:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
os: >-
['ubuntu-latest']
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.1.0 under development

- Enh #617: Add debug collector for yiisoft/yii-debug (@xepozz)
- Chg #722: Remove legacy array syntax for typecast. Use `Param` instead (@terabytesoftw)

## 1.0.0 April 12, 2023

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require-dev": {
"maglnet/composer-require-checker": "^4.2",
"phpunit/phpunit": "^9.6|^10.0",
"rector/rector": "^0.14",
"rector/rector": "^0.17",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.12.0",
Expand Down
157 changes: 83 additions & 74 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,76 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" executionOrder="default" failOnRisky="true" failOnWarning="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./src/TestSupport</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
<file>./src/Command/CommandInterface.php</file>
<file>./src/Command/ParamInterface.php</file>
<file>./src/Connection/ConnectionInterface.php</file>
<file>./src/Connection/ConnectionPoolInterface.php</file>
<file>./src/Constraint/ConstraintSchemaInterface.php</file>
<file>./src/Driver/DriverInterface.php</file>
<file>./src/Driver/PDO/CommandPDOInterface.php</file>
<file>./src/Driver/PDO/ConnectionPDOInterface.php</file>
<file>./src/Driver/PDO/ConnectionPDOPoolInterface.php</file>
<file>./src/Driver/PDO/PDODriverInterface.php</file>
<file>./src/Expression/ExpressionBuilderInterface.php</file>
<file>./src/Expression/ExpressionInterface.php</file>
<file>./src/Profiler/ProfilerInterface.php</file>
<file>./src/Query/BatchQueryResultInterface.php</file>
<file>./src/Query/Data/DataReaderInterface.php</file>
<file>./src/Query/QueryFunctionsInterface.php</file>
<file>./src/Query/QueryInterface.php</file>
<file>./src/Query/QueryPartsInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/BetweenColumnsConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/BetweenConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/ConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/ConjunctionConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/ExistConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/HashConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/InConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/LikeConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/NotConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/SimpleConditionInterface.php</file>
<file>./src/QueryBuilder/DDLQueryBuilderInterface.php</file>
<file>./src/QueryBuilder/DMLQueryBuilderInterface.php</file>
<file>./src/QueryBuilder/DQLQueryBuilderInterface.php</file>
<file>./src/QueryBuilder/QueryBuilderInterface.php</file>
<file>./src/Schema/ColumnSchemaInterface.php</file>
<file>./src/Schema/QuoterInterface.php</file>
<file>./src/Schema/SchemaInterface.php</file>
<file>./src/Schema/TableSchemaInterface.php</file>
<file>./src/Transaction/TransactionInterface.php</file>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
</php>
<testsuites>
<testsuite name="Db">
<directory>./tests/Db</directory>
</testsuite>
<testsuite name="ActiveRecord">
<directory>./vendor/yiisoft/active-record/tests/Driver</directory>
</testsuite>
<testsuite name="Mssql">
<directory>./vendor/yiisoft/db-mssql/tests</directory>
</testsuite>
<testsuite name="Mysql">
<directory>./vendor/yiisoft/db-mysql/tests</directory>
</testsuite>
<testsuite name="Oracle">
<directory>./vendor/yiisoft/db-oracle/tests</directory>
</testsuite>
<testsuite name="Pgsql">
<directory>./vendor/yiisoft/db-pgsql/tests</directory>
</testsuite>
<testsuite name="Sqlite">
<directory>./vendor/yiisoft/db-sqlite/tests</directory>
</testsuite>
</testsuites>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
executionOrder="default"
failOnRisky="true"
failOnWarning="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
>
<source>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./src/TestSupport</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
<file>./src/Command/CommandInterface.php</file>
<file>./src/Command/ParamInterface.php</file>
<file>./src/Connection/ConnectionInterface.php</file>
<file>./src/Connection/ConnectionPoolInterface.php</file>
<file>./src/Constraint/ConstraintSchemaInterface.php</file>
<file>./src/Driver/DriverInterface.php</file>
<file>./src/Driver/PDO/CommandPDOInterface.php</file>
<file>./src/Driver/PDO/ConnectionPDOInterface.php</file>
<file>./src/Driver/PDO/ConnectionPDOPoolInterface.php</file>
<file>./src/Driver/PDO/PDODriverInterface.php</file>
<file>./src/Expression/ExpressionBuilderInterface.php</file>
<file>./src/Expression/ExpressionInterface.php</file>
<file>./src/Profiler/ProfilerInterface.php</file>
<file>./src/Query/BatchQueryResultInterface.php</file>
<file>./src/Query/Data/DataReaderInterface.php</file>
<file>./src/Query/QueryFunctionsInterface.php</file>
<file>./src/Query/QueryInterface.php</file>
<file>./src/Query/QueryPartsInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/BetweenColumnsConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/BetweenConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/ConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/ConjunctionConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/ExistConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/HashConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/InConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/LikeConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/NotConditionInterface.php</file>
<file>./src/QueryBuilder/Condition/Interface/SimpleConditionInterface.php</file>
<file>./src/QueryBuilder/DDLQueryBuilderInterface.php</file>
<file>./src/QueryBuilder/DMLQueryBuilderInterface.php</file>
<file>./src/QueryBuilder/DQLQueryBuilderInterface.php</file>
<file>./src/QueryBuilder/QueryBuilderInterface.php</file>
<file>./src/Schema/ColumnSchemaInterface.php</file>
<file>./src/Schema/QuoterInterface.php</file>
<file>./src/Schema/SchemaInterface.php</file>
<file>./src/Schema/TableSchemaInterface.php</file>
<file>./src/Transaction/TransactionInterface.php</file>
</exclude>
</source>
<php>
<ini name="error_reporting" value="-1"/>
</php>
<testsuites>
<testsuite name="Db">
<directory>./tests/Db</directory>
</testsuite>
<testsuite name="ActiveRecord">
<directory>./vendor/yiisoft/active-record/tests/Driver</directory>
</testsuite>
<testsuite name="Mssql">
<directory>./vendor/yiisoft/db-mssql/tests</directory>
</testsuite>
<testsuite name="Mysql">
<directory>./vendor/yiisoft/db-mysql/tests</directory>
</testsuite>
<testsuite name="Oracle">
<directory>./vendor/yiisoft/db-oracle/tests</directory>
</testsuite>
<testsuite name="Pgsql">
<directory>./vendor/yiisoft/db-pgsql/tests</directory>
</testsuite>
<testsuite name="Sqlite">
<directory>./vendor/yiisoft/db-sqlite/tests</directory>
</testsuite>
</testsuites>
</phpunit>
11 changes: 9 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->disableParallel();

$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -21,4 +22,10 @@
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
]);

$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
AddDefaultValueForUndefinedVariableRector::class,
JsonThrowOnErrorRector::class,
]);
};
1 change: 0 additions & 1 deletion src/Connection/AbstractConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Yiisoft\Db\Connection;

use Closure;
use Exception;
use Throwable;
use Yiisoft\Db\Query\BatchQueryResult;
use Yiisoft\Db\Query\BatchQueryResultInterface;
Expand Down
Loading

0 comments on commit d3787c1

Please sign in to comment.