Skip to content

Commit

Permalink
Add migration Migration::class. (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Apr 26, 2023
1 parent 6656576 commit 41759bd
Show file tree
Hide file tree
Showing 40 changed files with 1,950 additions and 585 deletions.
20 changes: 11 additions & 9 deletions .gitattributes
Expand Up @@ -22,16 +22,18 @@
*.ttf binary

# Ignore some meta files when creating an archive of this repository
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs export-ignore
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.phpunit-watcher.yml export-ignore
/.styleci.yml export-ignore
/infection.json.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/tests export-ignore
/docs export-ignore

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

96 changes: 0 additions & 96 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/composer-require-checker.yml
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1']
['8.1', '8.2']
94 changes: 94 additions & 0 deletions .github/workflows/mssql.yml
@@ -0,0 +1,94 @@
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: mssql

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

env:
extensions: pdo, pdo_sqlsrv-5.10.1

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

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.0
- 8.1
- 8.2

mssql:
- server:2017-latest
- server:2019-latest

exclude:
- php: 8.0
mssql: server:2017-latest
- php: 8.1
mssql: server:2017-latest

services:
mssql:
image: mcr.microsoft.com/mssql/${{ matrix.mssql }}
env:
SA_PASSWORD: YourStrong!Passw0rd
ACCEPT_EULA: Y
MSSQL_PID: Developer
ports:
- 1433:1433
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

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

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

- 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
tools: composer:v2, pecl

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

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

- name: Run tests with phpunit.
run: vendor/bin/phpunit --testsuite=Mssql --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
45 changes: 26 additions & 19 deletions .github/workflows/mutation.yml
Expand Up @@ -9,6 +9,8 @@ on:
- 'psalm.xml'

push:
branches:
- "master"
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -23,6 +25,9 @@ jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
extensions: pdo, pdo_pgsql

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

strategy:
Expand All @@ -32,38 +37,40 @@ jobs:

php:
- 8.1
- 8.2

services:
postgres:
image: postgres:15
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: yiitest
ports:
- 5432:5432
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

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

- name: Install PHP
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: "${{ matrix.php }}"
extensions: ${{ env.extensions }}
ini-values: memory_limit=-1
coverage: pcov
tools: composer:v2

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install db-pgsql.
run: composer require yiisoft/db-pgsql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run infection
- name: Run infection.
run: |
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered --test-framework-options="--testsuite=Pgsql"
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
91 changes: 91 additions & 0 deletions .github/workflows/mysql.yml
@@ -0,0 +1,91 @@
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: mysql

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

env:
extensions: pdo, pdo_mysql

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

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.0
- 8.1
- 8.2

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:
image: ${{ matrix.mysql }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_PASSWORD: ''
MYSQL_DATABASE: yiitest
ports:
- 3306:3306
options: --health-cmd="mysqladmin 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: Install db-mysql.
run: composer require yiisoft/db-mysql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit.
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

0 comments on commit 41759bd

Please sign in to comment.