-
Notifications
You must be signed in to change notification settings - Fork 7
180 lines (166 loc) · 6.71 KB
/
Copy pathe2e-testing.yml
File metadata and controls
180 lines (166 loc) · 6.71 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: E2E test for EC-CUBE
on:
workflow_dispatch:
jobs:
codeception:
name: Codeception
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php: [ 8.0 ]
db: [ pgsql ]
group: [ 'admin01', 'admin02', 'admin03', 'front', 'restrict-fileupload', 'installer' ]
include:
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 14
- group: 'admin01'
app_env: 'codeception'
- group: 'admin02'
app_env: 'codeception'
- group: 'admin03'
app_env: 'codeception'
- group: 'front'
app_env: 'codeception'
- group: 'restrict-fileupload'
app_env: 'codeception'
- group: 'installer'
app_env: 'install'
services:
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout 4.2 Branch (POSTGRES)
uses: actions/checkout@master
with:
repository: ${{ github.repository_owner }}/ec-cube
ref: "4.2"
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Initialize Composer
uses: ./.github/actions/composer
- name: Setup to EC-CUBE
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
echo "APP_ENV=${APP_ENV}" > .env
echo "TRUSTED_HOSTS=127.0.0.1,localhost" >> .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: Download Plugin TwoFactorAuthCustomer42
uses: actions/checkout@master
with:
path: app/Plugin/TwoFactorAuthCustomer42
- name: Download Plugin TwoFactorAuthCustomerApp42
uses: actions/checkout@master
with:
repository: ${{ github.repository_owner }}/TwoFactorAuthCustomerApp42
path: app/Plugin/TwoFactorAuthCustomerApp42
- name: Download Plugin TwoFactorAuthCustomerSms42
uses: actions/checkout@master
with:
repository: ${{ github.repository_owner }}/TwoFactorAuthCustomerSms42
path: app/Plugin/TwoFactorAuthCustomerSms42
- name: Install Plugins
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
bin/console eccube:plugin:install --code=TwoFactorAuthCustomer42
bin/console cache:clear
bin/console eccube:plugin:enable --code=TwoFactorAuthCustomer42
bin/console cache:clear
bin/console eccube:plugin:install --code=TwoFactorAuthCustomerApp42
bin/console cache:clear
bin/console eccube:plugin:enable --code=TwoFactorAuthCustomerApp42
bin/console cache:clear
bin/console eccube:plugin:install --code=TwoFactorAuthCustomerSms42
bin/console cache:clear
bin/console eccube:plugin:enable --code=TwoFactorAuthCustomerSms42
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Run chromedriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
- name: Run package-api
run: |
if [[ ! -d ${PWD}/repos ]]; then mkdir -p ${PWD}/repos ; fi
docker run -d --rm -v ${PWD}/repos:/repos -e MOCK_REPO_DIR=/repos -p 8080:8080 eccube/mock-package-api:composer2
cp codeception/_data/plugins/*-1.0.0.tgz repos
- name: Start PHP Development Server
if: ${{ matrix.group != 'restrict-fileupload' }}
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_DSN: 'smtp://127.0.0.1:1025'
ECCUBE_PACKAGE_API_URL: 'http://127.0.0.1:8080'
run: php -S 127.0.0.1:8000 codeception/router.php &
- name: Start PHP Development Server
if: ${{ matrix.group == 'restrict-fileupload' }}
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_DSN: 'smtp://127.0.0.1:1025'
ECCUBE_PACKAGE_API_URL: 'http://127.0.0.1:8080'
ECCUBE_RESTRICT_FILE_UPLOAD: '1'
run: php -S 127.0.0.1:8000 codeception/router.php &
- name: Codeception
if: ${{ matrix.group != 'restrict-fileupload' }}
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_DSN: 'smtp://127.0.0.1:1025'
ECCUBE_PACKAGE_API_URL: 'http://127.0.0.1:8080'
GROUP: ${{ matrix.group }}
SYMFONY_DEPRECATIONS_HELPER: weak
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action -g ${GROUP} --skip-group restrict-file-upload --html report.html
- name: Codeception with Restrict file upload
if: ${{ matrix.group == 'restrict-fileupload' }}
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_DSN: 'smtp://127.0.0.1:1025'
ECCUBE_PACKAGE_API_URL: 'http://127.0.0.1:8080'
GROUP: ${{ matrix.group }}
SYMFONY_DEPRECATIONS_HELPER: weak
ECCUBE_RESTRICT_FILE_UPLOAD: '1'
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action -g ${GROUP} --html report.html
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-evidence
path: codeception/_output/
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-logs
path: var/log/