Skip to content

Commit db6daa8

Browse files
authored
Merge pull request #31 from phpbb-extensions/master-update
Merge 3.3.x into master
2 parents 9c8a745 + a6b0954 commit db6daa8

File tree

1 file changed

+47
-46
lines changed

1 file changed

+47
-46
lines changed

README.md

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,7 @@
22

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

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**.
6-
7-
## Table of Contents
8-
9-
- [Features](#features)
10-
- [How to Use](#how-to-use)
11-
- [Configuration Options](#configuration-options)
12-
- [Configuration Examples](#configuration-examples)
13-
14-
## Features
15-
16-
- Supports **PHP 8.x**
17-
- Tests against multiple database engines
18-
- Optional checks for:
19-
- PHP CodeSniffer
20-
- Image ICC profile removal
21-
- EPV (Extension Pre Validator)
22-
- Files with executable permissions
23-
- Code coverage reports via Codecov
24-
25-
## 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.
266

277
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.
288

@@ -51,7 +31,7 @@ jobs:
5131
EXTNAME: acme/demo # Your extension vendor/package name
5232
```
5333
54-
### Branches
34+
## Branches
5535
5636
Use the test-framework branch that matches the phpBB version you're developing for:
5737
@@ -64,12 +44,12 @@ Use the test-framework branch that matches the phpBB version you're developing f
6444
> uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
6545
> ```
6646

67-
### Requirements
47+
## Requirements
6848

6949
- 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**.
7050
- Tests must be defined in your repository using PHPUnit.
7151

72-
## Configuration Options
52+
# Configuration Options
7353

7454
You can fine-tune this workflow with several optional arguments in the `with` section:
7555

@@ -151,9 +131,9 @@ call-tests:
151131
CODECOV: 0
152132
```
153133

154-
## Configuration Examples
134+
# Configuration Examples
155135

156-
### Test an extension with phpBB 3.3.x
136+
## Test an extension with phpBB 3.3.x
157137

158138
```yaml
159139
call-tests:
@@ -163,7 +143,7 @@ call-tests:
163143
EXTNAME: acme/demo
164144
```
165145

166-
### Test an extension with phpBB's master-dev version
146+
## Test an extension with phpBB's master-dev version
167147

168148
```yaml
169149
call-tests:
@@ -173,7 +153,7 @@ call-tests:
173153
EXTNAME: acme/demo
174154
```
175155

176-
### Test an extension but skip the PostgreSQL on Linux and Windows tests
156+
## Test an extension but skip the PostgreSQL on Linux and Windows tests
177157

178158
```yaml
179159
call-tests:
@@ -185,7 +165,7 @@ call-tests:
185165
RUN_WINDOWS_JOBS: 0
186166
```
187167

188-
### Test an extension that has no PHPUnit tests (basic checks only)
168+
## Test an extension that has no PHPUnit tests (basic checks only)
189169

190170
```yaml
191171
call-tests:
@@ -199,7 +179,7 @@ call-tests:
199179
RUN_WINDOWS_JOBS: 0
200180
```
201181

202-
### Test an extension that has no Functional tests
182+
## Test an extension that has no Functional tests
203183

204184
```yaml
205185
call-tests:
@@ -210,7 +190,7 @@ call-tests:
210190
RUN_FUNCTIONAL_TESTS: 0
211191
```
212192

213-
### Test an extension that only supports PHP 8+
193+
## Test an extension that only supports PHP 8+
214194

215195
```yaml
216196
call-tests:
@@ -222,7 +202,7 @@ call-tests:
222202
PHP_VERSION_MATRIX: '["8.0", "8.1", "8.2", "8.3", "8.4"]'
223203
```
224204

225-
### Test an extension that has composer and NPM dependencies
205+
## Test an extension that has composer and NPM dependencies
226206

227207
```yaml
228208
call-tests:
@@ -234,7 +214,7 @@ call-tests:
234214
RUN_COMPOSER_INSTALL: 1
235215
```
236216

237-
### Test an extension + generate a code coverage report
217+
## Test an extension + generate a code coverage report
238218

239219
This test framework supports code coverage reporting through [Codecov.io](https://codecov.io).
240220

@@ -249,24 +229,45 @@ call-tests:
249229
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # This must be included
250230
```
251231

252-
#### Get Your Codecov Token (if required)
232+
> **Get Your Codecov Token (if required)**
233+
>
234+
> Most public repositories do **not** require a token.
235+
> For private repositories or certain CI setups, you may need a global **Codecov token**:
236+
>
237+
> - Visit [https://codecov.io](https://codecov.io)
238+
> - Log in with your **GitHub** account
239+
> - Go to your [Codecov account settings](https://app.codecov.io/account/token)
240+
> - Copy the token
241+
>
242+
> Then, in your GitHub repository:
243+
>
244+
> - Navigate to **Settings → Secrets and variables → Actions**
245+
> - Click **"New repository secret"**
246+
> - Name it `CODECOV_TOKEN` and paste your token value
247+
>
248+
> 💡 You can view your coverage reports and badges by visiting your extension's page on [Codecov.io](https://codecov.io).
249+
250+
## When the configuration options aren’t enough
253251

254-
Most public repositories do **not** require a token.
255-
For private repositories or certain CI setups, you may need a global **Codecov token**:
252+
If testing your extension requires more flexibility than the provided configuration options allow, you have two choices:
256253

257-
- Visit [https://codecov.io](https://codecov.io)
258-
- Log in with your **GitHub** account
259-
- Go to your [Codecov account settings](https://app.codecov.io/account/token)
260-
- Copy the token
254+
**Open an Issue** – If something is missing or could be improved, feel free to [open an issue](https://github.com/phpbb-extensions/test-framework/issues). Suggestions and feedback are welcome and may help improve the framework for everyone.
261255

262-
Then, in your GitHub repository:
256+
**Create Your Own Custom Version** – For highly specific needs, you can create your own version of this framework by using it as a template. Just click **Use this template → Create a new repository** to get started. Once your custom repository is set up, you can modify the workflow as needed. Then, reference your version of the framework from your extension’s test workflow like so:
263257

264-
- Navigate to **Settings → Secrets and variables → Actions**
265-
- Click **"New repository secret"**
266-
- Name it `CODECOV_TOKEN` and paste your token value
258+
```yaml
259+
call-tests:
260+
name: Extension tests
261+
uses: your-org/your-repo/.github/workflows/tests.yml@your-branch
262+
with:
263+
EXTNAME: acme/demo
264+
PHPBB_BRANCH: master
265+
```
267266

268-
> 💡 You can view your coverage reports and badges by visiting your extension's page on [Codecov.io](https://codecov.io).
267+
# Contributing
268+
269+
Issues and pull requests are welcome! If you have suggestions for improvement, feel free to [open an issue](https://github.com/phpbb-extensions/test-framework/issues).
269270

270-
## License
271+
# License
271272

272273
[GNU General Public License v2](license.txt)

0 commit comments

Comments
 (0)