Skip to content

Commit 95c2b53

Browse files
authored
Merge branch 'master' into patch
2 parents 3d03108 + db6daa8 commit 95c2b53

File tree

2 files changed

+53
-48
lines changed

2 files changed

+53
-48
lines changed

.github/workflows/tests.yml

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
type: string
99
PHPBB_BRANCH:
1010
required: false
11-
default: '3.3.x'
11+
default: 'master'
1212
type: string
1313
SNIFF:
1414
required: false
@@ -61,11 +61,11 @@ on:
6161
PRIMARY_PHP_VERSION:
6262
required: false
6363
type: string
64-
default: '7.2'
64+
default: '8.1'
6565
PHP_VERSION_MATRIX:
6666
required: false
6767
type: string
68-
default: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]'
68+
default: '["8.1", "8.2", "8.3", "8.4"]'
6969
secrets:
7070
CODECOV_TOKEN:
7171
required: false
@@ -84,7 +84,7 @@ jobs:
8484
# START Basic Checks Job (EPV, code sniffer, images check, etc.)
8585
basic-checks:
8686
if: ${{ inputs.EPV == '1' || inputs.EXECUTABLE_FILES == '1' || inputs.IMAGE_ICC == '1' || inputs.SNIFF == '1' }}
87-
runs-on: ubuntu-22.04
87+
runs-on: ubuntu-latest
8888
strategy:
8989
matrix:
9090
include:
@@ -111,7 +111,7 @@ jobs:
111111
uses: shivammathur/setup-php@v2
112112
with:
113113
php-version: ${{ matrix.php }}
114-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap
114+
extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv
115115
coverage: none
116116

117117
- name: Setup environment for phpBB
@@ -153,32 +153,34 @@ jobs:
153153
# START MySQL and MariaDB Job
154154
mysql-tests:
155155
if: ${{ inputs.RUN_MYSQL_JOBS == '1' }}
156-
runs-on: ubuntu-22.04
156+
runs-on: ubuntu-latest
157157
strategy:
158158
matrix:
159159
php: ${{ fromJSON(inputs.PHP_VERSION_MATRIX) }}
160-
db: ['mysql:5.7']
160+
db: ['mysql:8.0', 'mysql:8.1', 'mariadb:10.5']
161161
include:
162-
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
163-
db: 'mariadb:10.1'
164162
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
165163
db: 'mariadb:10.2'
166164
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
167165
db: 'mariadb:10.3'
168166
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
169167
db: 'mariadb:10.4'
170168
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
171-
db: 'mariadb:10.5'
169+
db: 'mariadb:10.6'
170+
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
171+
db: 'mariadb:10.9'
172+
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
173+
db: 'mariadb:10.10'
172174
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
173-
db: 'mysql:5.6'
175+
db: 'mariadb:10.11'
174176
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
175-
db: 'mysql:5.6'
177+
db: 'mysql:5.7'
176178
db_alias: 'MyISAM Tests'
177179
MYISAM: 1
178180
- php: ${{ startsWith(inputs.PRIMARY_PHP_VERSION, '7') && '7.4' || inputs.PRIMARY_PHP_VERSION }}
179-
db: 'mysql:8.0'
181+
db: 'mysql:5.7'
180182
COVERAGE: ${{ inputs.CODECOV == '1' && '1' || '0' }}
181-
db_alias: ${{ inputs.CODECOV == '1' && 'mysql:8.0 with Coverage' || 'mysql:8.0' }}
183+
db_alias: ${{ inputs.CODECOV == '1' && 'mysql:5.7 with Coverage' || 'mysql:5.7' }}
182184

183185
name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}
184186

@@ -271,7 +273,7 @@ jobs:
271273
run: |
272274
if [ $COVERAGE == '1' ]
273275
then
274-
sed -n '1h;1!H;${;g;s/<\/php>/<\/php>\n\t<filter>\n\t\t<whitelist>\n\t\t\t<directory>..\/<\/directory>\n\t\t\t<exclude>\n\t\t\t\t<directory>..\/tests\/<\/directory>\n\t\t\t\t<directory>..\/language\/<\/directory>\n\t\t\t\t<directory>..\/migrations\/<\/directory>\n\t\t\t<\/exclude>\n\t\t<\/whitelist>\n\t<\/filter>/g;p;}' .github/phpunit-$DB-github.xml &> phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml
276+
sed -n '1h;1!H;${;g;s/<\/php>/<\/php>\n\t<coverage>\n\t\t<include>\n\t\t\t<directory>..\/<\/directory>\n\t\t<\/include>\n\t\t<exclude>\n\t\t\t<directory>..\/tests\/<\/directory>\n\t\t\t<directory>..\/language\/<\/directory>\n\t\t\t<directory>..\/migrations\/<\/directory>\n\t\t<\/exclude>\n\t<\/coverage>/g;p;}' .github/phpunit-$DB-github.xml &> phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml
275277
else
276278
mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
277279
fi
@@ -316,11 +318,11 @@ jobs:
316318
# START PostgreSQL Job
317319
postgres-tests:
318320
if: ${{ inputs.RUN_PGSQL_JOBS == '1' }}
319-
runs-on: ubuntu-22.04
321+
runs-on: ubuntu-latest
320322
strategy:
321323
matrix:
322324
php: ${{ fromJSON(inputs.PHP_VERSION_MATRIX) }}
323-
db: ['postgres:14']
325+
db: ['postgres:15']
324326
include:
325327
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
326328
db: 'postgres:9.5'
@@ -334,12 +336,14 @@ jobs:
334336
db: 'postgres:12'
335337
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
336338
db: 'postgres:13'
339+
- php: ${{ inputs.PRIMARY_PHP_VERSION }}
340+
db: 'postgres:14'
337341

338342
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
339343

340344
services:
341345
postgres:
342-
image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && 'postgres:10' || matrix.db }}
346+
image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }}
343347
env:
344348
POSTGRES_HOST: localhost
345349
POSTGRES_USER: postgres
@@ -387,7 +391,7 @@ jobs:
387391
uses: shivammathur/setup-php@v2
388392
with:
389393
php-version: ${{ matrix.php }}
390-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap
394+
extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, pgsql, pdo, pdo_pgsql
391395
coverage: none
392396

393397
- name: Setup environment for phpBB
@@ -452,11 +456,12 @@ jobs:
452456
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
453457
db_alias: 'MSSQL 2022'
454458

459+
455460
name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}
456461

457462
services:
458463
mssql:
459-
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' || matrix.db }}
464+
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' || matrix.db }}
460465
env:
461466
SA_PASSWORD: "Pssw0rd_12"
462467
ACCEPT_EULA: "y"
@@ -496,7 +501,7 @@ jobs:
496501
env:
497502
MATRIX_DB: ${{ matrix.db }}
498503
run: |
499-
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ]
504+
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ]
500505
then
501506
db='mssql'
502507
else
@@ -508,7 +513,7 @@ jobs:
508513
uses: shivammathur/setup-php@v2
509514
with:
510515
php-version: ${{ matrix.php }}
511-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap
516+
extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, sqlsrv, pdo, pdo_sqlsrv
512517
coverage: none
513518

514519
- name: Setup environment for phpBB
@@ -592,7 +597,7 @@ jobs:
592597
uses: shivammathur/setup-php@v2
593598
with:
594599
php-version: ${{ matrix.php }}
595-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql
600+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql, sodium
596601
ini-values: upload_tmp_dir=${{ runner.temp }}, sys_temp_dir=${{ runner.temp }}
597602
coverage: none
598603

@@ -627,14 +632,16 @@ jobs:
627632
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\files" /grant "Users:(OI)(CI)F" /T
628633
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\images" /grant "Users:(OI)(CI)F" /T
629634
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\store" /grant "Users:(OI)(CI)F" /T
635+
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\ext" /grant Users:F /T
636+
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\vendor-ext" /grant Users:F /T
637+
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\composer-ext.json" /grant Users:F /T
638+
icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\composer-ext.lock" /grant Users:F /T
630639
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("IIS_IUSRS", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow")
631640
$acl = Get-ACL "${env:TEMP_DIR}"
632641
$acl.AddAccessRule($accessRule)
633642
Set-ACL -Path "${env:TEMP_DIR}" -ACLObject $acl
634643
cd ${env:GITHUB_WORKSPACE}\phpBB3\phpBB
635644
php ..\composer.phar install
636-
php ..\composer.phar remove phpunit/dbunit --dev --update-with-dependencies
637-
php ..\composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 phpunit/phpunit:^9.3 doctrine/instantiator:^1.4 --dev --update-with-all-dependencies --ignore-platform-reqs
638645
cd ..
639646
640647
- name: Setup database

README.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Reusable GitHub Actions workflow for testing phpBB extensions across multiple environments.
44

5-
This repository provides a reusable GitHub Actions workflow designed for phpBB extension developers. It supports testing across PHP versions 7.2 through 8.x and database engines including MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. Optional checks include PHP CodeSniffer, Extension Pre Validator (EPV), executable file detection, image ICC profile removal, and code coverage reporting via Codecov.
6-
7-
# How to Use
5+
This repository provides a reusable GitHub Actions workflow designed for phpBB extension developers. It supports testing across PHP 8.x and database engines including MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. Optional checks include PHP CodeSniffer, Extension Pre Validator (EPV), executable file detection, image ICC profile removal, and code coverage reporting via Codecov.
86

97
On GitHub.com, go to your extension's repository, click **Add file → Create new file**, name it `.github/workflows/tests.yml`, add the workflow content shown below, and commit the file. Make sure to replace `acme/demo` with your actual extension vendor/package name, and optionally you may adjust any of the branch names and other checks.
108

@@ -28,7 +26,7 @@ on:
2826
jobs:
2927
call-tests:
3028
name: Extension tests
31-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x # The phpBB branch to run tests with
29+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master # The phpBB branch to run tests with
3230
with:
3331
EXTNAME: acme/demo # Your extension vendor/package name
3432
```
@@ -40,10 +38,10 @@ Use the test-framework branch that matches the phpBB version you're developing f
4038
- `3.3.x`: Targets the phpBB 3.3.x release line.
4139
- `master`: Targets the latest development version of phpBB (`master` branch).
4240

43-
> ‼️ Whichever branch of this framework you choose, be sure it is appended to the `uses:` line after the `@` symbol. For example, if you're targeting the `3.3.x` branch:
41+
> ‼️ Whichever branch of this framework you choose, be sure it is appended to the `uses:` line after the `@` symbol. For example, if you're targeting the `master` branch:
4442
>
4543
> ```yaml
46-
> uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
44+
> uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
4745
> ```
4846

4947
## Requirements
@@ -58,19 +56,19 @@ You can fine-tune this workflow with several optional arguments in the `with` se
5856
```yaml
5957
call-tests:
6058
name: Extension tests
61-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
59+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
6260
with:
6361
EXTNAME: acme/demo # Your extension vendor/package name
6462
6563
# OPTIONAL CONFIGURATIONS BELOW
6664
# The following arguments are optional and can be omitted if not needed.
6765
6866
# The phpBB branch to use when running tests.
69-
# Default is '3.3.x', which this framework is designed for.
70-
# If using a different branch, ensure it's compatible with 3.3.x.
71-
# To test with phpBB's master branch, refer to the Branches section of this README.
72-
# Default: '3.3.x'
73-
PHPBB_BRANCH: '3.3.x'
67+
# Default is 'master', which this framework is designed for.
68+
# If using a different branch, ensure it's compatible with master.
69+
# To test with phpBB's 3.3.x branch, refer to the Branches section of this README.
70+
# Default: 'master'
71+
PHPBB_BRANCH: 'master'
7472
7573
# Run phpBB's EPV (Extension Pre Validator)? 1 (yes) or 0 (no)
7674
# Default: 1
@@ -117,16 +115,16 @@ call-tests:
117115
RUN_COMPOSER_INSTALL: 0
118116
119117
# CUSTOMISE PHP VERSIONS
120-
# To override the default PHP versions tested (7.2 through 8.4):
118+
# To override the default PHP versions tested (8.1 through 8.4):
121119
122120
# Preferred PHP version used for all test jobs.
123-
# Default: '7.2'
124-
PRIMARY_PHP_VERSION: '7.2'
121+
# Default: '8.1'
122+
PRIMARY_PHP_VERSION: '8.1'
125123
126124
# The MySQL and PostgreSQL jobs run tests across multiple PHP versions.
127125
# List the PHP versions you want your extension tested with.
128-
# Default: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]'
129-
PHP_VERSION_MATRIX: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]'
126+
# Default: '["8.1", "8.2", "8.3", "8.4"]'
127+
PHP_VERSION_MATRIX: '["8.1", "8.2", "8.3", "8.4"]'
130128
131129
# Generate a code coverage report (see documentation below)? 1 (yes) or 0 (no)
132130
# Default: 0
@@ -160,7 +158,7 @@ call-tests:
160158
```yaml
161159
call-tests:
162160
name: Extension tests
163-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
161+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
164162
with:
165163
EXTNAME: acme/demo
166164
RUN_PGSQL_JOBS: 0
@@ -172,7 +170,7 @@ call-tests:
172170
```yaml
173171
call-tests:
174172
name: Extension tests
175-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
173+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
176174
with:
177175
EXTNAME: acme/demo
178176
RUN_MYSQL_JOBS: 0
@@ -186,7 +184,7 @@ call-tests:
186184
```yaml
187185
call-tests:
188186
name: Extension tests
189-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
187+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
190188
with:
191189
EXTNAME: acme/demo
192190
RUN_FUNCTIONAL_TESTS: 0
@@ -197,7 +195,7 @@ call-tests:
197195
```yaml
198196
call-tests:
199197
name: Extension tests
200-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
198+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
201199
with:
202200
EXTNAME: acme/demo
203201
PRIMARY_PHP_VERSION: '8.0'
@@ -223,7 +221,7 @@ This test framework supports code coverage reporting through [Codecov.io](https:
223221
```yaml
224222
call-tests:
225223
name: Extension tests
226-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
224+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
227225
with:
228226
EXTNAME: acme/demo
229227
CODECOV: 1
@@ -263,7 +261,7 @@ call-tests:
263261
uses: your-org/your-repo/.github/workflows/tests.yml@your-branch
264262
with:
265263
EXTNAME: acme/demo
266-
PHPBB_BRANCH: 3.3.x
264+
PHPBB_BRANCH: master
267265
```
268266

269267
# Contributing

0 commit comments

Comments
 (0)