Repository navigation
237 lines (225 loc) · 9.03 KB
/
Copy pathci.yml
File metadata and controls
237 lines (225 loc) · 9.03 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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: CI Joomla Framework
on:
push:
pull_request:
schedule:
- cron: 15 2 * * 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
composer:
name: Install PHP dependencies
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.3
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v5
id: cache-php
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Install PHP dependencies
if: steps.cache-php.outputs.cache-hit != 'true'
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer config --global home
composer install --no-progress --ignore-platform-reqs
code-style-php:
name: Check PHP code style
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.3
needs: [composer]
steps:
- uses: actions/checkout@v6
- uses: actions/cache/restore@v5
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Check PHP code style
env:
PHP_CS_FIXER_IGNORE_ENV: true
run: ./vendor/bin/phpcs --standard=ruleset.xml src/
phpstan:
name: Run PHPstan
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.4
needs: [code-style-php]
steps:
- uses: actions/checkout@v6
- uses: actions/cache/restore@v5
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Run PHPstan
run: |
./vendor/bin/phpstan --error-format=github
tests-unit:
name: Run Unit tests
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v6
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit
tests-unit-sqlite:
name: Run Unit tests on SQLite
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v6
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.sqlite.xml.dist
tests-unit-mysql:
name: Run Unit tests on MySQL
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
db_engine: ['mysql', 'mysqli']
db_version: ['5.7', '8.0', '9']
steps:
- uses: actions/checkout@v6
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.${{ matrix.db_engine }}.xml.dist
services:
mysql:
image: mysql:${{ matrix.db_version }}
env:
MYSQL_USER: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_DATABASE: joomla_ut
options: >-
--health-cmd="mysqladmin ping -h localhost -u joomla_ut -pjoomla_ut"
tests-unit-mariadb:
name: Run Unit tests on MariaDB
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
db_version: ['10.4', '10.6', '10.11', '11.4', '11.8', '12.3']
steps:
- uses: actions/checkout@v6
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.mariadb.xml.dist
services:
mariadb:
image: mariadb:${{ matrix.db_version }}
env:
MARIADB_USER: joomla_ut
MARIADB_PASSWORD: joomla_ut
MARIADB_ROOT_PASSWORD: joomla_ut
MARIADB_DATABASE: joomla_ut
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
tests-unit-postgres:
name: Run Unit tests on PostgreSQL
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
db_version: ['10', '12', '18']
steps:
- uses: actions/checkout@v6
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.pgsql.xml.dist
services:
postgres:
image: postgres:${{ matrix.db_version }}-alpine
env:
POSTGRES_USER: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_DB: joomla_ut
options: >-
--health-cmd="pg_isready -d joomla_ut"
tests-unit-sqlsrv:
name: Run Unit tests on SQLsrv
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
db_version: ['2017', '2025']
steps:
- uses: actions/checkout@v4
- name: Prepare SQLSRV environment
run: |
curl -sSL -O https://packages.microsoft.com/config/debian/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2 | cut -d '.' -f 1)/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
pecl install sqlsrv && docker-php-ext-enable sqlsrv
php --ri sqlsrv
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist
services:
sqlsrv:
image: mcr.microsoft.com/mssql/server:${{ matrix.db_version }}-latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Password12!
MSSQL_PID: Developer
options: >-
--health-cmd="bash -c 'SQLCMD=$(command -v /opt/mssql-tools/bin/sqlcmd || command -v /opt/mssql-tools18/bin/sqlcmd); [ -z \"$SQLCMD\" ] && exit 1; $SQLCMD -S localhost -U sa -P Password12! -C -Q SELECT\ 1'"
tests-unit-windows:
name: Run Unit tests on MSSQL (Windows)
runs-on: windows-latest
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: ${{ matrix.php_version }}
extensions: openssl, mbstring, fileinfo, ftp, sqlsrv
- name: Install MSSQL
uses: potatoqualitee/mssqlsuite@2291d923e83859edd871679c05b379037376761f # v1.12
with:
install: sqlengine, sqlclient
version: 2019
sa-password: 'Password12!'
show-log: true
- name: Install Composer dependencies
run: |
git config --global --add safe.directory ${env:GITHUB_WORKSPACE}
composer update
- name: Run Unit tests
run: php vendor/bin/phpunit -c phpunit.windows.xml.dist