Repository navigation
214 lines (203 loc) · 7.85 KB
/
Copy pathci.yml
File metadata and controls
214 lines (203 loc) · 7.85 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
name: CI Joomla Framework
on:
push:
pull_request:
schedule:
- cron: 15 2 * * 1
workflow_dispatch:
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@v4
- uses: actions/cache@v4
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@v4
- uses: actions/cache/restore@v4
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]
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Run PHPstan
run: |
./vendor/bin/phpstan --error-format=github
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']
steps:
- uses: actions/checkout@v4
- 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']
db_engine: ['mysql', 'mysqli']
db_version: ['5.7', '8.0']
steps:
- uses: actions/checkout@v4
- 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
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']
steps:
- uses: actions/checkout@v4
- 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:10.2
env:
MARIADB_USER: joomla_ut
MARIADB_PASSWORD: joomla_ut
MARIADB_ROOT_PASSWORD: joomla_ut
MARIADB_DATABASE: joomla_ut
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']
db_version: ['10', '11']
steps:
- uses: actions/checkout@v4
- 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: root
POSTGRES_PASSWORD: joomla_ut
POSTGRES_DB: test_joomla
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']
steps:
- uses: actions/checkout@v4
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
apt-get update
apt-get install -y software-properties-common lsb-release gnupg
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
echo "deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" >> /etc/apt/sources.list
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
pecl install sqlsrv && docker-php-ext-enable sqlsrv
pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv
php --ri sqlsrv
php --ri pdo_sqlsrv
composer update
./vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist
services:
sqlsrv:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
SA_PASSWORD: Password12!
ACCEPT_EULA: Y
MSSQL_PID: Developer
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']
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: openssl, mbstring, fileinfo, ftp, sqlsrv
- name: Install MSSQL
uses: potatoqualitee/mssqlsuite@v1.8
with:
install: sqlengine, sqlclient
version: 2019
sa-password: 'Password12!'
show-log: true
- name: Install Composer dependencies
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer install --no-progress --ignore-platform-reqs
- name: Run Unit tests
run: php vendor/bin/phpunit -c phpunit.appveyor_sql2019.xml.dist