This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (208 loc) · 6.32 KB
/
php.yaml
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: PHP Check
on:
workflow_call:
pull_request:
merge_group:
jobs:
stan:
name: PHP Stan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.3
tools: composer:v2
extensions: intl, mbstring, imap, zip, dom, pdo_mysql
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Dependencies
run: make vendor -B
- name: PHP Stan Analyse
run: vendor/bin/phpstan analyse
lint:
name: Symfony Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.3
tools: composer:v2
extensions: intl, mbstring, imap, zip, dom, pdo_mysql
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Dependencies
run: make all -B
env:
APP_ENV: dev
- name: Lint Container
run: bin/console lint:container
- name: Lint Twig
run: bin/console lint:twig
coverage:
name: PHP Code Coverage
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.6.4
ports:
- 3306
env:
MYSQL_USER: db
MYSQL_PASSWORD: db
MYSQL_DATABASE: db_test
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ssh-key: '${{ secrets.SSHKEY }}'
lfs: true
- uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.3
tools: composer:v2
extensions: intl, mbstring, imap, zip, dom, pdo_mysql
- name: Replace variables
env:
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
echo "DATABASE_URL=mysql://db:db@127.0.0.1:${DB_PORT}/db?serverVersion=mariadb-10.6.4" >> .env.test.local
echo "APP_VERSION=test" >> .env.test.local
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Dependencies
run: make all -B
- run: make coverage.xml
- name: Check test coverage
id: test-coverage
uses: johanvanhelden/gha-clover-test-coverage-check@v1
with:
percentage: "50"
filename: "coverage.xml"
- uses: actions/upload-artifact@master
if: ${{ always() }}
with:
name: coverage
path: coverage-html
infection:
name: PHP Infection Test
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.6.4
ports:
- 3306
env:
MYSQL_USER: db
MYSQL_PASSWORD: db
MYSQL_DATABASE: db_test
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ssh-key: '${{ secrets.SSHKEY }}'
lfs: true
- uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.3
tools: composer:v2
extensions: intl, mbstring, imap, zip, dom, pdo_mysql
- name: Replace variables
env:
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
echo "DATABASE_URL=mysql://db:db@127.0.0.1:${DB_PORT}/db?serverVersion=mariadb-10.6.4" >> .env.test.local
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Dependencies
run: make all -B
- run: make infection_test
- uses: actions/upload-artifact@master
if: ${{ failure() }}
with:
name: infection_log
path: infection.log
test:
name: Unittest
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php: [8.3]
experimental: [false]
#include:
# - php: 8.4
# experimental: true
services:
mariadb:
image: mariadb:10.6.4
ports:
- 3306
env:
MYSQL_USER: db
MYSQL_PASSWORD: db
MYSQL_DATABASE: db_test
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: shivammathur/setup-php@2.31.1
with:
php-version: ${{ matrix.php }}
tools: composer:v2
extensions: intl, mbstring, imap, zip, dom, pdo_mysql
- name: Replace variables
env:
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
echo "DATABASE_URL=mysql://db:db@127.0.0.1:${DB_PORT}/db?serverVersion=mariadb-10.6.4" >> .env.test.local
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- run: make install -B
name: Install dependencies
env:
APP_ENV: test
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run Unittests
run: bin/phpunit
env:
APP_ENV: test