-
Notifications
You must be signed in to change notification settings - Fork 803
144 lines (124 loc) · 4.71 KB
/
end-to-end.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: End-to-End
on:
workflow_call:
permissions:
contents: read
concurrency:
group: end-to-end-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
Mink:
strategy:
matrix:
MINK_TAG: [
'account',
'checkout1',
'checkout2',
'detail',
'listing',
'note',
'sitemap',
'misc',
'backend'
]
runs-on: ubuntu-latest
env:
SW_HOST: localhost:8080
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: root
DB_NAME: shopware
MAILER_DSN: smtp://localhost:1025
SW_BASE_PATH: ''
SELENIUM_HOST: localhost
SMTP_HOST: localhost
services:
database:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: shopware
options: '--mount="type=tmpfs,destination=/var/lib/mysql" --health-cmd="mysqladmin ping -h 127.0.0.1" --health-interval=5s --health-timeout=2s --health-retries=3'
ports:
- "3306:3306"
mail:
image: axllent/mailpit
ports:
- "1025:1025"
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Install Caddy
run: |
set -e
wget -q https://github.com/caddyserver/caddy/releases/download/v2.7.6/caddy_2.7.6_linux_amd64.tar.gz
tar xfv caddy_2.7.6_linux_amd64.tar.gz
sudo mv caddy /usr/local/bin
- name: Start PHP-FPM
run: |
set -e
set -x
cat <<EOF > fpm.conf
[global]
error_log = /dev/fd/2
daemonize = no
[www]
listen = 127.0.0.1:5068
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.status_path = /__php-fpm-status__
; Ensure worker stdout and stderr are sent to the main error log
catch_workers_output = yes
php_admin_value[error_log] = /dev/fd/2
php_admin_flag[log_errors] = on
; we want to expose env vars (like in FOO=bar symfony server:start)
clear_env = no
env['PGGSSENCMODE'] = disable
env['LC_ALL'] = C
EOF
php-fpm --nodaemonize --fpm-config fpm.conf &
- name: Start Caddy
run: |
cat <<EOF > Caddyfile
:8080 {
root * .
php_fastcgi 127.0.0.1:5068 {
index shopware.php
}
file_server
}
EOF
caddy run --config Caddyfile &
- name: Start Selenium
run: docker run -d --network host --shm-size 3g selenium/standalone-chrome:94.0
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Shopware
run: make init
- name: Prepare Mink tests
run: make prepare-mink
- name: Run Mink tests
run: vendor/bin/behat -vv --config=tests/Mink/behat.yml --format=pretty --out=std --tags ${{ matrix.MINK_TAG }}
- name: Archive results
if: always()
uses: actions/upload-artifact@v4
with:
name: build-data-${{ matrix.MINK_TAG }}
path: build/logs