Skip to content

Commit d933d4f

Browse files
committed
enable unit tests in githib workflow
1 parent 5165fcc commit d933d4f

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-version: ['8.0']
17-
db-type: ['sqlite', 'mysql', 'pgsql']
18-
prefer-lowest: ['']
16+
php-version: [ '8.0' ]
17+
db-type: [ 'sqlite', 'mysql', 'pgsql' ]
18+
prefer-lowest: [ '' ]
1919
include:
2020
- php-version: '8.0'
2121
db-type: 'sqlite'
@@ -67,24 +67,24 @@ jobs:
6767
fi
6868
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then composer lowest-setup; fi
6969
70-
# - name: Setup problem matchers for PHPUnit
71-
# if: matrix.db-type == 'mysql'
72-
# run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
73-
74-
# - name: Wait for MySQL
75-
# if: matrix.db-type == 'mysql'
76-
# run: while ! `mysqladmin ping -h 127.0.0.1 --silent`; do printf 'Waiting for MySQL...\n'; sleep 2; done;
77-
78-
# - name: Run PHPUnit
79-
# run: |
80-
# if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
81-
# if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:root@127.0.0.1/cakephp?encoding=utf8'; fi
82-
# if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:postgres@127.0.0.1/postgres'; fi
83-
# if [[ ${{ matrix.php-version }} == '7.3' && ${{ matrix.db-type }} == 'sqlite' ]]; then
84-
# vendor/bin/phpunit --coverage-clover=coverage.xml
85-
# else
86-
# vendor/bin/phpunit
87-
# fi
70+
- name: Setup problem matchers for PHPUnit
71+
if: matrix.db-type == 'mysql'
72+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
73+
74+
- name: Wait for MySQL
75+
if: matrix.db-type == 'mysql'
76+
run: while ! `mysqladmin ping -h 127.0.0.1 --silent`; do printf 'Waiting for MySQL...\n'; sleep 2; done;
77+
78+
- name: Run PHPUnit
79+
run: |
80+
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
81+
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:root@127.0.0.1/cakephp?encoding=utf8'; fi
82+
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:postgres@127.0.0.1/postgres'; fi
83+
if [[ ${{ matrix.php-version }} == '8.0' && ${{ matrix.db-type }} == 'sqlite' ]]; then
84+
vendor/bin/phpunit --coverage-clover=coverage.xml
85+
else
86+
vendor/bin/phpunit
87+
fi
8888
8989
- name: Validate prefer-lowest
9090
run: if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/validate-prefer-lowest -m; fi

0 commit comments

Comments
 (0)