forked from EC-CUBE/ec-cube
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (116 loc) · 4.63 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
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: [ '7.4', '8.0', '8.1', '8.2' ]
db: [ mysql, pgsql, sqlite3 ]
include:
- db: mysql
database_url: mysql://root:[email protected]:3306/eccube_db
database_server_version: 5
database_charset: utf8mb4
- db: pgsql
database_url: postgres://postgres:[email protected]:5432/eccube_db
database_server_version: 14
database_charset: utf8
- db: sqlite3
database_url: sqlite:///var/eccube.db
database_server_version: 3
database_charset: utf8
services:
mysql:
image: mysql:5.7
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:14
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: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- 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: |
vendor/bin/phpunit --group cache-clear
vendor/bin/phpunit --group cache-clear-install
vendor/bin/phpunit --group update-schema-doctrine --exclude-group update-schema-doctrine-install
vendor/bin/phpunit --group update-schema-doctrine-install --filter=testInstallPluginWithNoProxy
vendor/bin/phpunit --group update-schema-doctrine-install --filter=testInstallPluginWithProxy
vendor/bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithNoProxy
vendor/bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithProxy
vendor/bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithNoProxy
vendor/bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithProxy
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
vendor/bin/phpunit --group plugin-service