Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github ci PR #100 2.x #102

Merged
merged 8 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1]
db_image_name: [mysql, percona, postgres]
include:
- db_image_name: mysql
db_image_version: 8
db: mysql
vars: '-e MYSQL_PASSWORD=myPassword -e MYSQL_DATABASE=doctrine_extensions_tests -e MYSQL_USER=u_doctrine_extensions -e MYSQL_ROOT_PASSWORD=myPassword'
db_port: 3306
health: '--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10'
- db_image_name: percona
db_image_version: 8
db: mysql
vars: '-e MYSQL_PASSWORD=myPassword -e MYSQL_DATABASE=doctrine_extensions_tests -e MYSQL_USER=u_doctrine_extensions -e MYSQL_ROOT_PASSWORD=myPassword'
db_port: 3306
health: '--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10'
- db_image_name: postgres
db_image_version: 15
db: pgsql
vars: '-e POSTGRES_DB=doctrine_extensions_tests -e POSTGRES_USER=u_doctrine_extensions -e POSTGRES_PASSWORD=myPassword'
health: '--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5'
db_port: 5432

services:
database:
image: ${{ matrix.db_image_name }}:${{ matrix.db_image_version }}
ports:
- ${{ matrix.db_port }}:${{ matrix.db_port }}
options: >-
${{ matrix.vars }}
${{ matrix.health }}

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
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions tests/config/mysql.phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<php>
<var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_username" value="travis" />
<var name="db_password" value="travis" />
<var name="db_username" value="u_doctrine_extensions" />
<var name="db_password" value="myPassword" />
<var name="db_name" value="doctrine_extensions_tests" />
<var name="db_port" value="33060"/>
<var name="db_port" value="3306"/>
</php>

<testsuites>
Expand Down
8 changes: 4 additions & 4 deletions tests/config/pgsql.phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
>
<php>
<var name="db_type" value="pdo_pgsql"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_username" value="travis" />
<var name="db_password" value="travis" />
<var name="db_host" value="localhost" />
<var name="db_username" value="u_doctrine_extensions" />
<var name="db_password" value="myPassword" />
<var name="db_name" value="doctrine_extensions_tests" />
<var name="db_port" value="54320"/>
<var name="db_port" value="5432"/>
</php>

<testsuites>
Expand Down
Loading