Skip to content

Commit f504ac4

Browse files
committed
Add configuration examples
1 parent 38e62d8 commit f504ac4

1 file changed

Lines changed: 87 additions & 16 deletions

File tree

README.md

Lines changed: 87 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This repository contains a pre-configured test workflow designed for phpBB exten
99
-[Features](#-features)
1010
- 🚀 [How to Use](#-how-to-use)
1111
- 🛠 [Configuration Options](#-configuration-options)
12-
- 📊 [Code Coverage with Codecov](#-code-coverage-with-codecov)
12+
- [Configuration Examples](#-configuration-examples)
1313

1414
## ✨ Features
1515

@@ -151,32 +151,105 @@ call-tests:
151151
CODECOV: 0
152152
```
153153

154-
## 📊 Code Coverage with Codecov
154+
## Configuration Examples
155155

156-
This test framework supports code coverage reporting through [Codecov.io](https://codecov.io). To enable it, follow these steps:
156+
### Test an extension with phpBB 3.3.x
157157

158-
### 1. Add a `codecov.yml` Path Fix
158+
```yaml
159+
call-tests:
160+
name: Extension tests
161+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
162+
with:
163+
EXTNAME: acme/demo
164+
```
165+
166+
### Test an extension with phpBB's master-dev version
167+
168+
```yaml
169+
call-tests:
170+
name: Extension tests
171+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
172+
with:
173+
EXTNAME: acme/demo
174+
```
175+
176+
### Test an extension but skip the PostgreSQL on Linux and Windows tests
177+
178+
```yaml
179+
call-tests:
180+
name: Extension tests
181+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
182+
with:
183+
EXTNAME: acme/demo
184+
RUN_PGSQL_JOBS: 0
185+
RUN_WINDOWS_JOBS: 0
186+
```
187+
188+
### Test an extension that has no PHPUnit tests (basic checks only)
189+
190+
```yaml
191+
call-tests:
192+
name: Extension tests
193+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
194+
with:
195+
EXTNAME: acme/demo
196+
RUN_MYSQL_JOBS: 0
197+
RUN_PGSQL_JOBS: 0
198+
RUN_MSSQL_JOBS: 0
199+
RUN_WINDOWS_JOBS: 0
200+
```
159201

160-
Codecov may report incorrect file paths if phpBB is cloned into a subdirectory. To fix this, add a `codecov.yml` file to the `.github/` directory of your extension’s repository with the following content:
202+
### Test an extension that has no Functional tests
161203

162204
```yaml
163-
fixes:
164-
- "/phpBB3/phpBB/ext/acme/demo/::"
205+
call-tests:
206+
name: Extension tests
207+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
208+
with:
209+
EXTNAME: acme/demo
210+
RUN_FUNCTIONAL_TESTS: 0
211+
```
212+
213+
### Test an extension that only supports PHP 8+
214+
215+
```yaml
216+
call-tests:
217+
name: Extension tests
218+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
219+
with:
220+
EXTNAME: acme/demo
221+
PRIMARY_PHP_VERSION: '8.0'
222+
PHP_VERSION_MATRIX: '["8.0", "8.1", "8.2", "8.3", "8.4"]'
165223
```
166224

167-
Make sure to replace `acme/demo` with your actual extension vendor/package name.
225+
### Test an extension that has composer and NPM dependencies
168226

169-
### 2. Enable Codecov in the Workflow
227+
```yaml
228+
call-tests:
229+
name: Extension tests
230+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
231+
with:
232+
EXTNAME: acme/demo
233+
RUN_NPM_INSTALL: 1
234+
RUN_COMPOSER_INSTALL: 1
235+
```
170236

171-
Ensure `CODECOV: 1` is set in your workflow call:
237+
### Test an extension + generate a code coverage report
238+
239+
This test framework supports code coverage reporting through [Codecov.io](https://codecov.io).
172240

173241
```yaml
174-
with:
175-
...
176-
CODECOV: 1
242+
call-tests:
243+
name: Extension tests
244+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
245+
with:
246+
EXTNAME: acme/demo
247+
CODECOV: 1
248+
secrets: # This must be included
249+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # This must be included
177250
```
178251

179-
### 3. Get Your Codecov Token (if required)
252+
#### Get Your Codecov Token (if required)
180253

181254
Most public repositories do **not** require a token.
182255
For private repositories or certain CI setups, you may need a global **Codecov token**:
@@ -192,8 +265,6 @@ Then, in your GitHub repository:
192265
- Click **"New repository secret"**
193266
- Name it `CODECOV_TOKEN` and paste your token value
194267

195-
Once set up, Codecov will automatically collect and display coverage reports for your extension after each test run.
196-
197268
> 💡 You can view your coverage reports and badges by visiting your extension's page on [Codecov.io](https://codecov.io).
198269

199270
## 📄 License

0 commit comments

Comments
 (0)