-
Notifications
You must be signed in to change notification settings - Fork 55
66 lines (56 loc) · 2.59 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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