Repository navigation
128 lines (112 loc) · 3.67 KB
/
Copy pathtests.yml
File metadata and controls
128 lines (112 loc) · 3.67 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
name: Tests
# For most extensions, this workflow should not need changing;
# simply commit it to your repository.
#
# See the README for full details and configuration instructions:
# - https://github.com/phpbb-extensions/test-framework
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
call-tests:
name: Extension tests
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
with:
EXTNAME: phpbbmodders/knowledgebase
# EPV runs in the epv job below instead
EPV: 0
RUN_MYSQL_JOBS: 0
RUN_PGSQL_JOBS: 0
RUN_MSSQL_JOBS: 0
RUN_WINDOWS_JOBS: 0
PRIMARY_PHP_VERSION: '8.3'
PHP_VERSION_MATRIX: '["8.1", "8.3", "8.4", "8.5"]'
# phpBB 4.0 (master): the same tests with the framework's master branch
call-tests-master:
name: Extension tests (phpBB master / 4.0)
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
with:
EXTNAME: phpbbmodders/knowledgebase
# EPV runs in the epv job below instead
EPV: 0
PHPBB_BRANCH: 'master'
RUN_MYSQL_JOBS: 0
RUN_PGSQL_JOBS: 0
RUN_MSSQL_JOBS: 0
RUN_WINDOWS_JOBS: 0
PRIMARY_PHP_VERSION: '8.3'
PHP_VERSION_MATRIX: '["8.3", "8.4", "8.5"]'
# EPV (Extension Pre Validator), failing on any Fatal or Error finding not
# listed in .github/epv-allowed.txt
epv:
uses: phpbbmodders/.github/.github/workflows/epv.yml@v1
with:
EXTNAME: phpbbmodders/knowledgebase
PHPBB_BRANCHES: '["3.3.x", "master"]'
# The extension's own PHPUnit suite (tests/*_test.php), including the
# MySQL and PostgreSQL tests, on phpBB 3.3.x and master. The framework jobs
# above find no phpunit.xml.dist here, so they do not run it.
phpunit:
name: PHPUnit - phpBB ${{ matrix.phpbb }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
phpbb: ['3.3.x', 'master']
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: kb_fixture
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --host=127.0.0.1 --user=root --silent"
--health-interval=5s
--health-timeout=5s
--health-retries=20
postgres:
image: postgres:16-alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: kb_fixture
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready --username=postgres --dbname=kb_fixture"
--health-interval=5s
--health-timeout=5s
--health-retries=20
steps:
- name: Checkout phpBB
uses: actions/checkout@v4
with:
repository: phpbb/phpbb
ref: ${{ matrix.phpbb }}
path: phpBB3
- name: Checkout extension
uses: actions/checkout@v4
with:
path: phpBB3/phpBB/ext/phpbbmodders/knowledgebase
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
update: true
extensions: dom, intl, mbstring, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, sqlite3
coverage: none
- name: Install phpBB dependencies
working-directory: ./phpBB3
run: .github/setup-phpbb.sh none 8.3 1
- name: Run PHPUnit
working-directory: ./phpBB3/phpBB/ext/phpbbmodders/knowledgebase
env:
PHPBB_ROOT_PATH: ${{ github.workspace }}/phpBB3/phpBB
KB_TEST_MYSQL_PORT: '3306'
KB_TEST_POSTGRES_PORT: '5432'
run: php ../../../vendor/bin/phpunit --do-not-cache-result --fail-on-skipped --test-suffix _test.php tests