-
Notifications
You must be signed in to change notification settings - Fork 652
126 lines (121 loc) · 5.03 KB
/
unit-test.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Unit test for EC-CUBE
on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
jobs:
phpunit:
name: PHPUnit
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ '8.1', '8.2', '8.3' ]
db: [ mysql, pgsql, sqlite3 ]
include:
- db: mysql
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
database_server_version: 8
database_charset: utf8mb4
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 16
database_charset: utf8
- db: sqlite3
database_url: sqlite:///var/eccube.db
database_server_version: 3
database_charset: utf8
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: :xdebug
- name: Initialize Composer
uses: ./.github/actions/composer
- name: Setup EC-CUBE
env:
APP_ENV: 'test'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
DATABASE_CHARSET: ${{ matrix.database_charset }}
run: |
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console eccube:fixtures:load
- name: PHPUnit
env:
APP_ENV: 'test'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
DATABASE_CHARSET: ${{ matrix.database_charset }}
MAILER_URL: 'smtp://127.0.0.11025'
run: vendor/bin/phpunit --exclude-group cache-clear,cache-clear-install,update-schema-doctrine,plugin-service
- name: PHPUnit
env:
APP_ENV: 'test'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
DATABASE_CHARSET: ${{ matrix.database_charset }}
MAILER_URL: 'smtp://127.0.0.11025'
run: |
echo "session.save_path=$PWD/var/sessions/test" > php.ini
echo "memory_limit=512M" >> php.ini
php -c php.ini vendor/bin/phpunit --group cache-clear
php -c php.ini vendor/bin/phpunit --group cache-clear-install
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine --exclude-group update-schema-doctrine-install
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testInstallPluginWithNoProxy
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testInstallPluginWithProxy
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithNoProxy
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithProxy
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithNoProxy
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithProxy
php -c php.ini vendor/bin/phpunit --group update-schema-doctrine-install --filter=testCreateEntityAndTrait
## XXX MySQL で Syntax error or access violation: 1305 SAVEPOINT DOCTRINE2_SAVEPOINT_3 does not exist が
## 発生するため \DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener を削除する
## see https://github.com/dmaicher/doctrine-test-bundle/issues/58#issuecomment-391081408
- run: sed -e '/DoctrineTestBundle/d' phpunit.xml.dist > phpunit.xml
if: ${{ matrix.db == 'mysql' }}
- name: PHPUnit
env:
APP_ENV: 'test'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
DATABASE_CHARSET: ${{ matrix.database_charset }}
MAILER_URL: 'smtp://127.0.0.11025'
run: |
rm -r app/Plugin/*
git checkout app/Plugin
rm -r var/cache
echo "session.save_path=$PWD/var/sessions/test" > php.ini
echo "memory_limit=512M" >> php.ini
php -c php.ini vendor/bin/phpunit --group plugin-service