Skip to content

Commit bee9302

Browse files
committed
with all dbs
1 parent ad8d516 commit bee9302

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

.github/workflows/test-unit.yml

+35-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
- php: 'latest'
8484
type: 'Phpunit Burn'
8585
env:
86-
LOG_COVERAGE: 1 # "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == '8.0' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}"
86+
LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == '8.0' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}"
8787
services:
8888
mysql:
8989
image: mysql:8
@@ -160,14 +160,36 @@ jobs:
160160
- name: "Run tests: MySQL (only for Phpunit)"
161161
if: startsWith(matrix.type, 'Phpunit')
162162
env:
163-
DB_DSN: "mysql:dbname=atk4_test;host=mysql"
163+
DB_DSN: "mysql:dbname=host=mysql;atk4_test"
164164
DB_USER: atk4_test
165165
DB_PASSWD: atk4_pass
166166
run: |
167167
php demos/_demo-data/create-db.php
168168
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
169169
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mysql.cov; fi
170170
171+
- name: "Run tests: MariaDB (only for Phpunit)"
172+
if: startsWith(matrix.type, 'Phpunit')
173+
env:
174+
DB_DSN: "mysql:host=mariadb;dbname=atk4_test"
175+
DB_USER: atk4_test
176+
DB_PASSWD: atk4_pass
177+
run: |
178+
php demos/_demo-data/create-db.php
179+
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
180+
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mariadb.cov; fi
181+
182+
- name: "Run tests: PostgreSQL (only for Phpunit)"
183+
if: startsWith(matrix.type, 'Phpunit')
184+
env:
185+
DB_DSN: "pgsql:host=postgres;dbname=atk4_test"
186+
DB_USER: atk4_test
187+
DB_PASSWD: atk4_pass
188+
run: |
189+
php demos/_demo-data/create-db.php
190+
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
191+
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-postgres.cov; fi
192+
171193
- name: "Run tests: MSSQL (only for Phpunit)"
172194
if: startsWith(matrix.type, 'Phpunit')
173195
env:
@@ -179,6 +201,17 @@ jobs:
179201
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
180202
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mssql.cov; fi
181203
204+
- name: "Run tests: Oracle (only for Phpunit)"
205+
if: startsWith(matrix.type, 'Phpunit')
206+
env:
207+
DB_DSN: "oci:dbname=oracle/xe;charset=UTF8"
208+
DB_USER: system
209+
DB_PASSWD: oracle
210+
run: |
211+
php demos/_demo-data/create-db.php
212+
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
213+
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-oracle.cov; fi
214+
182215
- name: Upload coverage logs 1/2 (only for latest Phpunit)
183216
if: env.LOG_COVERAGE
184217
run: |

0 commit comments

Comments
 (0)