Skip to content

Commit 70cde6d

Browse files
authored
Merge pull request #30 from iMattPro/experimental-3.3.x
Readme updates
2 parents 1f66dd9 + 906d4c9 commit 70cde6d

File tree

1 file changed

+48
-45
lines changed

1 file changed

+48
-45
lines changed

README.md

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,9 @@
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**.
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.
66

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 7.2+** through **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
7+
# How to Use
268

279
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.
2810

@@ -51,7 +33,7 @@ jobs:
5133
EXTNAME: acme/demo # Your extension vendor/package name
5234
```
5335
54-
### Branches
36+
## Branches
5537
5638
Use the test-framework branch that matches the phpBB version you're developing for:
5739
@@ -64,12 +46,12 @@ Use the test-framework branch that matches the phpBB version you're developing f
6446
> uses: phpbb-extensions/test-framework/.github/workflows/[email protected]
6547
> ```
6648

67-
### Requirements
49+
## Requirements
6850

6951
- 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**.
7052
- Tests must be defined in your repository using PHPUnit.
7153

72-
## Configuration Options
54+
# Configuration Options
7355

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

@@ -151,9 +133,9 @@ call-tests:
151133
CODECOV: 0
152134
```
153135

154-
## Configuration Examples
136+
# Configuration Examples
155137

156-
### Test an extension with phpBB 3.3.x
138+
## Test an extension with phpBB 3.3.x
157139

158140
```yaml
159141
call-tests:
@@ -163,7 +145,7 @@ call-tests:
163145
EXTNAME: acme/demo
164146
```
165147

166-
### Test an extension with phpBB's master-dev version
148+
## Test an extension with phpBB's master-dev version
167149

168150
```yaml
169151
call-tests:
@@ -173,7 +155,7 @@ call-tests:
173155
EXTNAME: acme/demo
174156
```
175157

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

178160
```yaml
179161
call-tests:
@@ -185,7 +167,7 @@ call-tests:
185167
RUN_WINDOWS_JOBS: 0
186168
```
187169

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

190172
```yaml
191173
call-tests:
@@ -199,7 +181,7 @@ call-tests:
199181
RUN_WINDOWS_JOBS: 0
200182
```
201183

202-
### Test an extension that has no Functional tests
184+
## Test an extension that has no Functional tests
203185

204186
```yaml
205187
call-tests:
@@ -210,7 +192,7 @@ call-tests:
210192
RUN_FUNCTIONAL_TESTS: 0
211193
```
212194

213-
### Test an extension that only supports PHP 8+
195+
## Test an extension that only supports PHP 8+
214196

215197
```yaml
216198
call-tests:
@@ -222,7 +204,7 @@ call-tests:
222204
PHP_VERSION_MATRIX: '["8.0", "8.1", "8.2", "8.3", "8.4"]'
223205
```
224206

225-
### Test an extension that has composer and NPM dependencies
207+
## Test an extension that has composer and NPM dependencies
226208

227209
```yaml
228210
call-tests:
@@ -234,7 +216,7 @@ call-tests:
234216
RUN_COMPOSER_INSTALL: 1
235217
```
236218

237-
### Test an extension + generate a code coverage report
219+
## Test an extension + generate a code coverage report
238220

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

@@ -249,24 +231,45 @@ call-tests:
249231
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # This must be included
250232
```
251233

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

262-
Then, in your GitHub repository:
256+
**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.
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+
**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:
267259

268-
> 💡 You can view your coverage reports and badges by visiting your extension's page on [Codecov.io](https://codecov.io).
260+
```yaml
261+
call-tests:
262+
name: Extension tests
263+
uses: your-org/your-repo/.github/workflows/tests.yml@your-branch
264+
with:
265+
EXTNAME: acme/demo
266+
PHPBB_BRANCH: 3.3.x
267+
```
268+
269+
# Contributing
270+
271+
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).
269272

270-
## License
273+
# License
271274

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

0 commit comments

Comments
 (0)