Skip to content

Commit

Permalink
with all dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 7, 2021
1 parent ad8d516 commit bee9302
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- php: 'latest'
type: 'Phpunit Burn'
env:
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')))] }}"
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')))] }}"
services:
mysql:
image: mysql:8
Expand Down Expand Up @@ -160,14 +160,36 @@ jobs:
- name: "Run tests: MySQL (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
env:
DB_DSN: "mysql:dbname=atk4_test;host=mysql"
DB_DSN: "mysql:dbname=host=mysql;atk4_test"
DB_USER: atk4_test
DB_PASSWD: atk4_pass
run: |
php demos/_demo-data/create-db.php
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mysql.cov; fi
- name: "Run tests: MariaDB (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
env:
DB_DSN: "mysql:host=mariadb;dbname=atk4_test"
DB_USER: atk4_test
DB_PASSWD: atk4_pass
run: |
php demos/_demo-data/create-db.php
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mariadb.cov; fi
- name: "Run tests: PostgreSQL (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
env:
DB_DSN: "pgsql:host=postgres;dbname=atk4_test"
DB_USER: atk4_test
DB_PASSWD: atk4_pass
run: |
php demos/_demo-data/create-db.php
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-postgres.cov; fi
- name: "Run tests: MSSQL (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
env:
Expand All @@ -179,6 +201,17 @@ jobs:
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mssql.cov; fi
- name: "Run tests: Oracle (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
env:
DB_DSN: "oci:dbname=oracle/xe;charset=UTF8"
DB_USER: system
DB_PASSWD: oracle
run: |
php demos/_demo-data/create-db.php
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-oracle.cov; fi
- name: Upload coverage logs 1/2 (only for latest Phpunit)
if: env.LOG_COVERAGE
run: |
Expand Down

0 comments on commit bee9302

Please sign in to comment.