fix: database host for tests #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [8.1] | |
db_image_name: [mysql, mariadb, percona, postgres] | |
include: | |
- db_image_name: mysql | |
db_image_version: 8 | |
db: mysql | |
vars: '-e MYSQL_PASSWORD=travis -e MYSQL_DATABASE=doctrine_extensions_tests -e MYSQL_USER=travis -e MYSQL_ROOT_PASSWORD=travis' | |
db_port: 3306 | |
- db_image_name: mariadb | |
db_image_version: 11 | |
db: mysql | |
vars: '-e MYSQL_PASSWORD=travis -e MYSQL_DATABASE=doctrine_extensions_tests -e MYSQL_USER=travis -e MYSQL_ROOT_PASSWORD=travis' | |
db_port: 3306 | |
- db_image_name: percona | |
db_image_version: 8 | |
db: mysql | |
vars: '-e MYSQL_PASSWORD=travis -e MYSQL_DATABASE=doctrine_extensions_tests -e MYSQL_USER=travis -e MYSQL_ROOT_PASSWORD=travis' | |
db_port: 3306 | |
- db_image_name: postgres | |
db_image_version: 15 | |
db: mysql | |
vars: '-e POSTGRES_DB=doctrine_extensions_tests -e POSTGRES_USER=travis -e POSTGRES_PASSWORD=travis' | |
db_port: 5432 | |
services: | |
database: | |
image: ${{ matrix.db_image }} | |
ports: | |
- ${{ matrix.db_port }}:{{ matrix.db_port }} | |
options: >- | |
${{ matrix.vars }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, pdo_pgsql | |
coverage: none | |
- name: Install dependencies | |
run: | | |
composer self-update | |
composer install --prefer-dist --optimize-autoloader --no-interaction --no-suggest | |
- name: Run setup tests | |
run: vendor/bin/phpunit --configuration tests/config/${{ matrix.db }}.phpunit.xml tests/Oro/Tests/Connection/SetupTest.php | |
- name: Run test suite | |
run: vendor/bin/phpunit --configuration tests/config/${{ matrix.db }}.phpunit.xml --testsuite="Oro Doctrine Extensions Test Suite" | |
- name: Check code style | |
run: vendor/bin/phpcs src/ tests/ -p --encoding=utf-8 --extensions=php --standard=psr2 | |
- name: Tear down tests | |
run: vendor/bin/phpunit --configuration tests/config/${{ matrix.db }}.phpunit.xml tests/Oro/Tests/Connection/TearDownTest.php |