You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-24Lines changed: 71 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,19 @@ Reusable GitHub Actions workflow for testing phpBB extensions across multiple en
4
4
5
5
This repository contains a pre-configured test workflow designed for phpBB extension developers. It runs your extension's tests using various PHP versions and database systems, including **MySQL**, **PostgreSQL**, **SQLite**, and **Microsoft SQL Server**.
-[⚙️ Customising the PHP Test Suite](#️-customising-the-php-test-suite)
16
+
-[📊 Code Coverage with Codecov](#-code-coverage-with-codecov)
17
+
-[📄 License](#-license)
18
+
19
+
## ✨ Features
8
20
9
21
- Supports **PHP 7.2+** through **8.x**
10
22
- Tests against multiple database engines
@@ -15,14 +27,7 @@ This repository contains a pre-configured test workflow designed for phpBB exten
15
27
- Executable files
16
28
- Code coverage via Codecov
17
29
18
-
## 🧪 Branches
19
-
20
-
-`3.3.x`: Targets the **phpBB 3.3.x** release line.
21
-
-`master`: Targets the latest development version of **phpBB** (`master` branch).
22
-
23
-
Use the branch that matches the phpBB version you're developing for.
24
-
25
-
## 📦 How to Use
30
+
## 🚀 How to Use
26
31
27
32
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.
28
33
@@ -58,11 +63,22 @@ jobs:
58
63
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Do not edit this
59
64
```
60
65
66
+
## 🧪 Branches
67
+
68
+
Use the branch that matches the phpBB version you're developing for.
69
+
70
+
- `3.3.x`: Targets the **phpBB 3.3.x** release line.
71
+
- `master`: Targets the latest development version of **phpBB** (`master` branch).
72
+
61
73
## ✅ Requirements
62
74
63
75
- Your extension's package contents must be located at the root level of the repository. That is, the repository **must directly represent the package**, with all relevant files such as `composer.json`, `README`, `LICENSE`, etc. placed directly in the **root of the repository**, **not inside a subdirectory within the repository**. See any of phpbb-extension's official extension repositories as an example.
64
76
- Tests must be defined in your repository using PHPUnit.
65
77
78
+
# Advanced Configuration Options
79
+
80
+
The following sections provide instruction for advanced users who are not able to use the default workflow out-of-the-box configuration. If your tests are failing with the default workflow, it may be because you need to change the PHP versions or skip certain jobs.
81
+
66
82
## ⏭️ Skipping Jobs
67
83
68
84
This test framework runs four primary job groups:
@@ -71,7 +87,7 @@ This test framework runs four primary job groups:
71
87
3. PostgreSQL - Tests using PostgreSQL database structures.
72
88
4. MSSQL - Tests using MSSQL and SQLite3 database structures.
73
89
74
-
You can skip any of these job groups—such as if your extension does not support MSSQL—by setting the appropriate arguments when using this workflow:
90
+
You can skip any of these job groups—such as if your extension does not support MSSQL—by setting the appropriate optional arguments when using this workflow:
75
91
76
92
```yaml
77
93
with:
@@ -85,6 +101,40 @@ with:
85
101
86
102
> Note: If you do not need to skip any jobs, you don’t need to include these arguments at all. For example, omitting `RUN_BASIC_JOBS` is equivalent to setting it to 1. You only need to define these arguments if you want to disable a job by setting its value to 0.
87
103
104
+
## 📦 Dependency Installation
105
+
106
+
If your extension requires **NPM** or **Composer** dependencies, you can enable automatic installation by setting the following arguments:
107
+
108
+
```yaml
109
+
with:
110
+
...
111
+
RUN_NPM_INSTALL: 1 # Set to 1 to run `npm ci`; otherwise set to 0 or omit
112
+
RUN_COMPOSER_INSTALL: 1# Set to 1 to run `composer install`; otherwise set to 0 or omit
113
+
...
114
+
```
115
+
116
+
> 💡 If you don't need either, you can omit these arguments entirely.
117
+
118
+
## ⚙️ Customising the PHP Test Suite
119
+
120
+
By default, this framework tests your extension against the full range of PHP versions supported by phpBB (7.2 through 8.4). You can override this by specifying the following optional inputs:
> 💡 Use these options if your extension supports only a specific set of PHP versions, or if you want to test against a narrower or newer PHP version range.
137
+
88
138
## 📊 Code Coverage with Codecov
89
139
90
140
This test framework supports code coverage reporting through [Codecov.io](https://codecov.io). To enable it, follow these steps:
@@ -100,16 +150,24 @@ fixes:
100
150
101
151
Make sure to replace `acme/demo` with your actual extension vendor/package name.
102
152
103
-
### 2. Sign in to Codecov
153
+
### 2. Enable Codecov in the Workflow
104
154
105
-
- Visit [https://codecov.io](https://codecov.io)
106
-
- Log in with your **GitHub** account
155
+
Ensure `CODECOV: 1` is set in your workflow call:
156
+
157
+
```yaml
158
+
with:
159
+
...
160
+
CODECOV: 1
161
+
...
162
+
```
107
163
108
164
### 3. Get Your Codecov Token (if required)
109
165
110
166
Most public repositories do **not** require a token.
111
167
For private repositories or certain CI setups, you may need a global **Codecov token**:
112
168
169
+
- Visit [https://codecov.io](https://codecov.io)
170
+
- Log in with your **GitHub** account
113
171
- Go to your [Codecov account settings](https://app.codecov.io/account/token)
114
172
- Copy the token
115
173
@@ -119,17 +177,6 @@ Then, in your GitHub repository:
119
177
- Click **"New repository secret"**
120
178
- Name it `CODECOV_TOKEN` and paste your token value
121
179
122
-
### 4. Enable Codecov in the Workflow
123
-
124
-
Ensure `CODECOV: 1` is set in your workflow call:
125
-
126
-
```yaml
127
-
with:
128
-
...
129
-
CODECOV: 1
130
-
...
131
-
```
132
-
133
180
Once set up, Codecov will automatically collect and display coverage reports for your extension after each test run.
134
181
135
182
> 💡 You can view your coverage reports and badges by visiting your extension's page on [Codecov.io](https://codecov.io).
0 commit comments