-
Notifications
You must be signed in to change notification settings - Fork 13
196 lines (172 loc) · 5.5 KB
/
integration.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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Integration
on:
pull_request:
push:
branches:
- main
permissions: read-all
env:
DATABASE_DRIVER: pdo_sqlite
DATABASE_URL: sqlite:///%kernel.project_dir%/var/db_test.sqlite
APP_ENV: test
APP_SECRET: 165e25e3846534bb4665d7078a851c0b
MAILER_URL: smtp://localhost:25?encryption=&auth_mode=
MAILER_DELIVERY_ADDRESS: [email protected]
APP_NAME: "Userli"
APP_URL: "https://users.example.org"
PROJECT_NAME: "example.org"
PROJECT_URL: "https://www.example.org"
DOMAIN: "example.org"
SENDER_ADDRESS: "[email protected]"
NOTIFICATION_ADDRESS: "[email protected]"
SEND_MAIL: 1
LOCALE: "de"
REGISTRATION_OPEN: 1
MAIL_CRYPT_ENABLED: 1
MAIL_CRYPT_AUTO: 1
jobs:
unit-tests:
runs-on: ubuntu-latest
name: PHPUnit
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: openssl, sodium
coverage: xdebug
tools: composer
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install
- name: PHPUnit
run: bin/phpunit --coverage-clover=coverage.xml
- name: Upload Test Coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
integration-sqlite:
runs-on: ubuntu-latest
name: Behat (SQLite)
needs: unit-tests
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: openssl, sodium
tools: composer
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Integration with SQLite
run: make integration
env:
DATABASE_DRIVER: pdo_sqlite
DATABASE_URL: sqlite:///%kernel.project_dir%/var/db_test.sqlite
integration-mariadb:
runs-on: ubuntu-latest
name: Behat (MariaDB)
needs: unit-tests
services:
mariadb:
image: mariadb:10.5
ports:
- 3306
env:
MYSQL_USER: mail_test
MYSQL_PASSWORD: password
MYSQL_DATABASE: mail_test
MYSQL_ROOT_PASSWORD: password
options: >-
--health-cmd="mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: openssl, sodium, mysql
tools: composer
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Integration with MariaDB
run: make integration
env:
DATABASE_DRIVER: pdo_mysql
DATABASE_URL: mysql://mail_test:[email protected]:${{ job.services.mariadb.ports[3306] }}/mail_test
integration-postgres:
runs-on: ubuntu-latest
name: Behat (PostgreSQL)
needs: unit-tests
services:
postgres:
image: postgres:13
ports:
- 5432
env:
POSTGRES_USER: mail_test
POSTGRES_PASSWORD: password
POSTGRES_DB: mail_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: openssl, sodium, pgsql
tools: composer
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Integration with PostgreSQL
run: make integration
env:
DATABASE_DRIVER: pdo_pgsql
DATABASE_URL: pgsql://mail_test:[email protected]:${{ job.services.postgres.ports[5432] }}/mail_test?charset=UTF8