Skip to content

Commit f573e71

Browse files
Test all supported RDMBS (#18)
* Test all supported RDBMS * Apply fixes from StyleCI * CI, PHPUnit config * Use env * Fix invalid yaml files * Fix env not loading * Fix env not loading in Github Actions * Fix env not loading in Github Actions 2 * WIP * WIP * Fix MySQL tests * Revert MySQL * Revert MySQL 2 * Revert MySQL 2 3 * Debug MySQL * Debug MySQL 2 * Debug MySQL 3 * Debug MySQL 4 * Debug MySQL 5 * Debug MySQL 6 * Debug MySQL 7 * Debug MySQL 8 * Debug MySQL 9 * Debug MySQL 10 * Try to use getenv * Apply fixes from StyleCI * Try to use export * Shorter syntax * Revert removed workflows * Revert removed workflows 2 * Test MySQL again * Use DB separately * Debug * Apply fixes from StyleCI * Debug 2 * Fix * Fix * Test * Apply fixes from StyleCI * Test * Test * Test 2 * Test 3 * Test 4 * Test again * Adjust tests for MSSQL, adapt testing SQL * Debug * Start to fix MySQL * Fix get sql * More fixes * More fixes 2 * More fixes 3 * More fixes 4 * Test * Apply fixes from StyleCI * Different approach * Apply fixes from StyleCI * Remove unused code * Fix MySQL tests * Centralized place for filling fixtures * Fix all tests expect MSSQL * Fix MSSQL tests --------- Co-authored-by: StyleCI Bot <[email protected]>
1 parent 64d50c6 commit f573e71

File tree

97 files changed

+1501
-329
lines changed

Some content is hidden

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

97 files changed

+1501
-329
lines changed

.github/workflows/build.yml

-33
This file was deleted.

.github/workflows/mssql.yml

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'infection.json.dist'
10+
- 'psalm.xml'
11+
12+
push:
13+
branches: ['master']
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'CHANGELOG.md'
18+
- '.gitignore'
19+
- '.gitattributes'
20+
- 'infection.json.dist'
21+
- 'psalm.xml'
22+
23+
name: mssql
24+
25+
jobs:
26+
tests:
27+
name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }}
28+
29+
env:
30+
extensions: pdo, pdo_sqlsrv-5.11.1
31+
32+
runs-on: ${{ matrix.os }}
33+
34+
strategy:
35+
matrix:
36+
os:
37+
- ubuntu-latest
38+
39+
php:
40+
- 8.1
41+
- 8.2
42+
- 8.3
43+
44+
mssql:
45+
- server:2019-latest
46+
- server:2022-latest
47+
48+
services:
49+
mssql:
50+
image: mcr.microsoft.com/mssql/${{ matrix.mssql }}
51+
env:
52+
SA_PASSWORD: YourStrong!Passw0rd
53+
ACCEPT_EULA: Y
54+
MSSQL_PID: Developer
55+
ports:
56+
- 1433:1433
57+
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
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v3
62+
63+
- name: Create MS SQL Database
64+
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
65+
66+
- name: Install PHP with extensions
67+
uses: shivammathur/setup-php@v2
68+
with:
69+
php-version: ${{ matrix.php }}
70+
extensions: ${{ env.extensions }}
71+
ini-values: date.timezone='UTC'
72+
coverage: pcov
73+
tools: composer:v2, pecl
74+
75+
- name: Determine composer cache directory
76+
if: matrix.os == 'ubuntu-latest'
77+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
78+
79+
- name: Cache dependencies installed with composer
80+
uses: actions/cache@v3
81+
with:
82+
path: ${{ env.COMPOSER_CACHE_DIR }}
83+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
84+
restore-keys: |
85+
php${{ matrix.php }}-composer-
86+
87+
- name: Update composer
88+
run: composer self-update
89+
90+
- name: Install dependencies with composer
91+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
92+
93+
- name: Run tests with phpunit
94+
run: vendor/bin/phpunit --testsuite Mssql --coverage-clover=coverage.xml --colors=always
95+
env:
96+
ENVIRONMENT: ci
97+
CYCLE_MSSQL_DATABASE: yiitest
98+
CYCLE_MSSQL_HOST: 127.0.0.1
99+
CYCLE_MSSQL_PORT: 1433
100+
CYCLE_MSSQL_USER: SA
101+
CYCLE_MSSQL_PASSWORD: YourStrong!Passw0rd
102+
103+
- name: Upload coverage to Codecov
104+
if: matrix.os == 'ubuntu-latest'
105+
uses: codecov/codecov-action@v3
106+
with:
107+
files: ./coverage.xml

.github/workflows/mysql.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'infection.json.dist'
10+
- 'psalm.xml'
11+
12+
push:
13+
branches: ['master']
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'CHANGELOG.md'
18+
- '.gitignore'
19+
- '.gitattributes'
20+
- 'infection.json.dist'
21+
- 'psalm.xml'
22+
23+
name: mysql
24+
25+
jobs:
26+
tests:
27+
name: PHP ${{ matrix.php }}-mysql-${{ matrix.mysql }}
28+
29+
env:
30+
extensions: pdo, pdo_mysql
31+
32+
runs-on: ${{ matrix.os }}
33+
34+
strategy:
35+
matrix:
36+
os:
37+
- ubuntu-latest
38+
39+
php:
40+
- 8.1
41+
- 8.2
42+
- 8.3
43+
44+
mysql:
45+
- 5.7
46+
- latest
47+
48+
services:
49+
mysql:
50+
image: mysql:${{ matrix.mysql }}
51+
env:
52+
MYSQL_ALLOW_EMPTY_PASSWORD: true
53+
MYSQL_PASSWORD: ''
54+
MYSQL_DATABASE: yiitest
55+
ports:
56+
- 3306:3306
57+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v3
62+
63+
- name: Install PHP with extensions
64+
uses: shivammathur/setup-php@v2
65+
with:
66+
php-version: ${{ matrix.php }}
67+
extensions: ${{ env.extensions }}
68+
ini-values: date.timezone='UTC'
69+
coverage: pcov
70+
71+
- name: Determine composer cache directory
72+
if: matrix.os == 'ubuntu-latest'
73+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
74+
75+
- name: Cache dependencies installed with composer
76+
uses: actions/cache@v3
77+
with:
78+
path: ${{ env.COMPOSER_CACHE_DIR }}
79+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
80+
restore-keys: |
81+
php${{ matrix.php }}-composer-
82+
83+
- name: Update composer
84+
run: composer self-update
85+
86+
- name: Install dependencies with composer
87+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
88+
89+
- name: Run tests with phpunit
90+
run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always
91+
env:
92+
ENVIRONMENT: ci
93+
CYCLE_MYSQL_DATABASE: yiitest
94+
CYCLE_MYSQL_HOST: 127.0.0.1
95+
CYCLE_MYSQL_PORT: 3306
96+
CYCLE_MYSQL_USER: root
97+
CYCLE_MYSQL_PASSWORD: ''
98+
99+
- name: Upload coverage to Codecov
100+
if: matrix.os == 'ubuntu-latest'
101+
uses: codecov/codecov-action@v3
102+
with:
103+
files: ./coverage.xml

.github/workflows/pgsql.yml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'infection.json.dist'
10+
- 'psalm.xml'
11+
12+
push:
13+
branches: ['master']
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'CHANGELOG.md'
18+
- '.gitignore'
19+
- '.gitattributes'
20+
- 'infection.json.dist'
21+
- 'psalm.xml'
22+
23+
name: pgsql
24+
25+
jobs:
26+
tests:
27+
name: PHP ${{ matrix.php }}-pgsql-${{ matrix.pgsql }}
28+
29+
env:
30+
extensions: pdo, pdo_pgsql
31+
32+
runs-on: ${{ matrix.os }}
33+
34+
strategy:
35+
matrix:
36+
os:
37+
- ubuntu-latest
38+
39+
php:
40+
- 8.1
41+
- 8.2
42+
- 8.3
43+
44+
pgsql:
45+
- 9
46+
- 10
47+
- 11
48+
- 12
49+
- 13
50+
- 14
51+
52+
services:
53+
postgres:
54+
image: postgres:${{ matrix.pgsql }}
55+
env:
56+
POSTGRES_USER: root
57+
POSTGRES_PASSWORD: root
58+
POSTGRES_DB: yiitest
59+
ports:
60+
- 5432:5432
61+
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
62+
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
67+
- name: Install PHP with extensions
68+
uses: shivammathur/setup-php@v2
69+
with:
70+
php-version: ${{ matrix.php }}
71+
extensions: ${{ env.extensions }}
72+
ini-values: date.timezone='UTC'
73+
coverage: pcov
74+
tools: composer:v2
75+
76+
- name: Determine composer cache directory
77+
if: matrix.os == 'ubuntu-latest'
78+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
79+
80+
- name: Cache dependencies installed with composer
81+
uses: actions/cache@v3
82+
with:
83+
path: ${{ env.COMPOSER_CACHE_DIR }}
84+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
85+
restore-keys: |
86+
php${{ matrix.php }}-composer-
87+
88+
- name: Update composer
89+
run: composer self-update
90+
91+
- name: Install dependencies with composer
92+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
93+
94+
- name: Run tests with phpunit
95+
run: vendor/bin/phpunit --testsuite Pgsql --coverage-clover=coverage.xml --colors=always
96+
env:
97+
ENVIRONMENT: ci
98+
CYCLE_PGSQL_DATABASE: yiitest
99+
CYCLE_PGSQL_HOST: 127.0.0.1
100+
CYCLE_PGSQL_PORT: 5432
101+
CYCLE_PGSQL_USER: root
102+
CYCLE_PGSQL_PASSWORD: root
103+
104+
- name: Upload coverage to Codecov
105+
if: matrix.os == 'ubuntu-latest'
106+
uses: codecov/codecov-action@v3
107+
with:
108+
files: ./coverage.xml

0 commit comments

Comments
 (0)