Skip to content

Commit cf3baa5

Browse files
Add migration Migration::class. (#58)
1 parent 6986cd2 commit cf3baa5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+724
-826
lines changed

.gitattributes

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@
2222
*.ttf binary
2323

2424
# Ignore some meta files when creating an archive of this repository
25-
/.github export-ignore
26-
/.editorconfig export-ignore
27-
/.gitattributes export-ignore
28-
/.gitignore export-ignore
29-
/.scrutinizer.yml export-ignore
30-
/phpunit.xml.dist export-ignore
31-
/tests export-ignore
32-
/docs export-ignore
25+
/.github export-ignore
26+
/.editorconfig export-ignore
27+
/.gitattributes export-ignore
28+
/.gitignore export-ignore
29+
/.phpunit-watcher.yml export-ignore
30+
/.styleci.yml export-ignore
31+
/infection.json.dist export-ignore
32+
/phpunit.xml.dist export-ignore
33+
/psalm.xml export-ignore
34+
/tests export-ignore
35+
/docs export-ignore
3336

3437
# Avoid merge conflicts in CHANGELOG
3538
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
3639
/CHANGELOG.md merge=union
37-

.github/workflows/composer-require-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
os: >-
3131
['ubuntu-latest']
3232
php: >-
33-
['8.0']
33+
['8.1', '8.2']

.github/workflows/mssql.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727

2828
env:
2929
extensions: pdo, pdo_sqlsrv-5.10.1
30-
key: cache
3130

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

@@ -39,16 +38,11 @@ jobs:
3938
php:
4039
- 8.0
4140
- 8.1
41+
- 8.2
4242

4343
mssql:
44-
- server:2017-latest
4544
- server:2019-latest
46-
47-
exclude:
48-
- php: 8.0
49-
mssql: server:2017-latest
50-
- php: 8.1
51-
mssql: server:2017-latest
45+
- server:2022-latest
5246

5347
services:
5448
mssql:
@@ -62,13 +56,13 @@ jobs:
6256
options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3
6357

6458
steps:
65-
- name: Checkout
59+
- name: Checkout.
6660
uses: actions/checkout@v3
6761

68-
- name: Create MS SQL Database
62+
- name: Create MS SQL Database.
6963
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
7064

71-
- name: Install PHP with extensions
65+
- name: Install PHP with extensions.
7266
uses: shivammathur/setup-php@v2
7367
with:
7468
php-version: ${{ matrix.php }}
@@ -77,23 +71,18 @@ jobs:
7771
coverage: pcov
7872
tools: composer:v2, pecl
7973

80-
- name: Determine composer cache directory
81-
if: matrix.os == 'ubuntu-latest'
82-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
83-
84-
- name: Cache dependencies installed with composer
85-
uses: actions/cache@v3
86-
with:
87-
path: ${{ env.COMPOSER_CACHE_DIR }}
88-
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
89-
restore-keys: |
90-
php${{ matrix.php }}-composer-
91-
92-
- name: Update composer
74+
- name: Update composer.
9375
run: composer self-update
9476

95-
- name: Install db-mssql
77+
- name: Install db-mssql.
9678
run: composer require yiisoft/db-mssql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
9779

98-
- name: Run tests with phpunit
99-
run: vendor/bin/phpunit --group Mssql --colors=always
80+
- name: Run tests with phpunit.
81+
run: vendor/bin/phpunit --testsuite=Mssql --coverage-clover=coverage.xml --colors=always
82+
83+
- name: Upload coverage to Codecov.
84+
if: matrix.php == '8.1'
85+
uses: codecov/codecov-action@v3
86+
with:
87+
token: ${{ secrets.CODECOV_TOKEN }}
88+
files: ./coverage.xml

.github/workflows/mutation.yml

Lines changed: 10 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ on:
99
- 'psalm.xml'
1010

1111
push:
12-
branches:
13-
- "master"
1412
paths-ignore:
1513
- 'docs/**'
1614
- 'README.md'
@@ -26,7 +24,7 @@ jobs:
2624
name: PHP ${{ matrix.php }}-${{ matrix.os }}
2725

2826
env:
29-
extensions: pdo, pdo_mysql, pdo_oci, pdo_pgsql, pdo_sqlsrv-5.10.1, oci8
27+
extensions: pdo, pdo_pgsql
3028

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

@@ -36,50 +34,25 @@ jobs:
3634
- ubuntu-latest
3735

3836
php:
39-
- 8.0
37+
- 8.1
38+
- 8.2
4039

4140
services:
42-
mssql:
43-
image: mcr.microsoft.com/mssql/server:2019-latest
44-
env:
45-
SA_PASSWORD: YourStrong!Passw0rd
46-
ACCEPT_EULA: Y
47-
MSSQL_PID: Developer
48-
ports:
49-
- 1433:1433
50-
options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3
51-
mysql:
52-
image: mysql:latest
53-
env:
54-
MYSQL_ALLOW_EMPTY_PASSWORD: true
55-
MYSQL_PASSWORD: ''
56-
MYSQL_DATABASE: yiitest
57-
ports:
58-
- 3306:3306
59-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
6041
postgres:
61-
image: postgres:14
42+
image: postgres:15
6243
env:
6344
POSTGRES_USER: root
6445
POSTGRES_PASSWORD: root
6546
POSTGRES_DB: yiitest
6647
ports:
6748
- 5432:5432
6849
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
69-
oci:
70-
image: wnameless/oracle-xe-11g-r2:latest
71-
ports:
72-
- 1521:1521
73-
options: --name=oci
7450

7551
steps:
76-
- name: Checkout
52+
- name: Checkout.
7753
uses: actions/checkout@v3
7854

79-
- name: Create MS SQL Database
80-
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
81-
82-
- name: Install PHP
55+
- name: Install PHP with extensions.
8356
uses: shivammathur/setup-php@v2
8457
with:
8558
php-version: "${{ matrix.php }}"
@@ -88,38 +61,14 @@ jobs:
8861
coverage: pcov
8962
tools: composer:v2
9063

91-
- name: Determine composer cache directory
92-
if: matrix.os == 'ubuntu-latest'
93-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
94-
95-
- name: Cache dependencies installed with composer
96-
uses: actions/cache@v3
97-
with:
98-
path: ${{ env.COMPOSER_CACHE_DIR }}
99-
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
100-
restore-keys: |
101-
php${{ matrix.php }}-composer-
102-
103-
- name: Update composer
64+
- name: Update composer.
10465
run: composer self-update
10566

106-
- name: Install db-mssql
107-
run: composer require yiisoft/db-mssql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
108-
109-
- name: Install db-mysql
110-
run: composer require yiisoft/db-mysql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
111-
112-
- name: Install db-oracle
113-
run: composer require yiisoft/db-oracle --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
114-
115-
- name: Install db-pgsql
67+
- name: Install db-pgsql.
11668
run: composer require yiisoft/db-pgsql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
11769

118-
- name: Install db-sqlite
119-
run: composer require yiisoft/db-sqlite --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
120-
121-
- name: Run infection
70+
- name: Run infection.
12271
run: |
123-
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
72+
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered --test-framework-options="--testsuite=Pgsql"
12473
env:
12574
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/mysql.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727

2828
env:
2929
extensions: pdo, pdo_mysql
30-
key: cache-v1
3130

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

@@ -39,14 +38,22 @@ jobs:
3938
php:
4039
- 8.0
4140
- 8.1
41+
- 8.2
4242

4343
mysql:
44-
- 5.7
45-
- latest
44+
- mysql:5.7
45+
- mysql:latest
46+
- mariadb:10.4
47+
- mariadb:10.5
48+
- mariadb:10.6
49+
- mariadb:10.7
50+
- mariadb:10.8
51+
- mariadb:10.9
52+
- mariadb:latest
4653

4754
services:
4855
mysql:
49-
image: mysql:${{ matrix.mysql }}
56+
image: ${{ matrix.mysql }}
5057
env:
5158
MYSQL_ALLOW_EMPTY_PASSWORD: true
5259
MYSQL_PASSWORD: ''
@@ -56,34 +63,29 @@ jobs:
5663
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
5764

5865
steps:
59-
- name: Checkout
66+
- name: Checkout.
6067
uses: actions/checkout@v3
6168

62-
- name: Install PHP with extensions
69+
- name: Install PHP with extensions.
6370
uses: shivammathur/setup-php@v2
6471
with:
6572
php-version: ${{ matrix.php }}
6673
extensions: ${{ env.extensions }}
6774
ini-values: date.timezone='UTC'
6875
coverage: pcov
6976

70-
- name: Determine composer cache directory
71-
if: matrix.os == 'ubuntu-latest'
72-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
73-
74-
- name: Cache dependencies installed with composer
75-
uses: actions/cache@v3
76-
with:
77-
path: ${{ env.COMPOSER_CACHE_DIR }}
78-
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
79-
restore-keys: |
80-
php${{ matrix.php }}-composer-
81-
82-
- name: Update composer
77+
- name: Update composer.
8378
run: composer self-update
8479

85-
- name: Install db-mysql
80+
- name: Install db-mysql.
8681
run: composer require yiisoft/db-mysql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
8782

88-
- name: Run tests with phpunit
89-
run: vendor/bin/phpunit --group Mysql --colors=always
83+
- name: Run tests with phpunit.
84+
run: vendor/bin/phpunit --testsuite=Mysql --coverage-clover=coverage.xml --colors=always
85+
86+
- name: Upload coverage to Codecov.
87+
if: matrix.php == '8.1'
88+
uses: codecov/codecov-action@v3
89+
with:
90+
token: ${{ secrets.CODECOV_TOKEN }}
91+
files: ./coverage.xml

.github/workflows/oracle.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ name: oracle
2323

2424
jobs:
2525
tests:
26-
name: PHP ${{ matrix.php }}-${{ matrix.os }}
26+
name: PHP ${{ matrix.php }}-oracle-${{ matrix.oracle }}
2727

2828
env:
2929
extensions: pdo, pdo_oci, oci8
30-
key: cache-v1
3130

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

@@ -39,19 +38,32 @@ jobs:
3938
php:
4039
- 8.0
4140
- 8.1
41+
- 8.2
42+
43+
oracle:
44+
- 18
45+
- 21
4246

4347
services:
4448
oci:
45-
image: wnameless/oracle-xe-11g-r2:latest
49+
image: gvenzl/oracle-xe:${{ matrix.oracle }}
4650
ports:
4751
- 1521:1521
48-
options: --name=oci
52+
env:
53+
ORACLE_DATABASE : yiitest
54+
ORACLE_PASSWORD : root
55+
options: >-
56+
--name=oci
57+
--health-cmd healthcheck.sh
58+
--health-interval 10s
59+
--health-timeout 5s
60+
--health-retries 10
4961
5062
steps:
51-
- name: Checkout
63+
- name: Checkout.
5264
uses: actions/checkout@v3
5365

54-
- name: Install PHP with extensions
66+
- name: Install PHP with extensions.
5567
uses: shivammathur/setup-php@v2
5668
with:
5769
php-version: ${{ matrix.php }}
@@ -60,22 +72,18 @@ jobs:
6072
coverage: pcov
6173
tools: composer:v2
6274

63-
- name: Determine composer cache directory
64-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
65-
66-
- name: Cache dependencies installed with composer
67-
uses: actions/cache@v3
68-
with:
69-
path: ${{ env.COMPOSER_CACHE_DIR }}
70-
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
71-
restore-keys: |
72-
php${{ matrix.php }}-composer-
73-
74-
- name: Update composer
75+
- name: Update composer.
7576
run: composer self-update
7677

77-
- name: Install db-oracle
78+
- name: Install db-oracle.
7879
run: composer require yiisoft/db-oracle --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7980

80-
- name: Run tests with phpunit
81-
run: vendor/bin/phpunit --group Oracle --colors=always
81+
- name: Run tests with phpunit.
82+
run: vendor/bin/phpunit --testsuite=Oracle --coverage-clover=coverage.xml --colors=always
83+
84+
- name: Upload coverage to Codecov.
85+
if: matrix.php == '8.1'
86+
uses: codecov/codecov-action@v3
87+
with:
88+
token: ${{ secrets.CODECOV_TOKEN }}
89+
files: ./coverage.xml

0 commit comments

Comments
 (0)