Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/tests/ export-ignore
/travis/ export-ignore
.github/ export-ignore
.travis.yml export-ignore
.gitignore export-ignore
.gitattributes export-ignore
phpunit.xml.dist export-ignore
Expand Down
2 changes: 0 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
-->
<delete dir="${dir}/.github" />
<delete dir="${dir}/tests" />
<delete dir="${dir}/travis" />

<delete file="${dir}/.gitignore" />
<delete file="${dir}/.travis.yml" />
<delete file="${dir}/build.xml" />
<delete file="${dir}/composer.lock" />
<delete file="${dir}/composer.phar" />
Expand Down
12 changes: 6 additions & 6 deletions config/skeletons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ services:
- 'tests'
- false
- []
- ['tests/controller/main_test.php', 'tests/dbal/fixtures/config.xml', 'tests/dbal/simple_test.php', 'tests/functional/view_test.php', 'phpunit.xml.dist']
- ['tests/controller/main_test.php', 'tests/dbal/fixtures/config.xml', 'tests/dbal/simple_test.php', 'tests/functional/view_test.php', 'phpunit.xml.dist', '.github/workflows/tests.yml']
- 'TEST_DEPLOY'
tags:
- { name: phpbb.skeleton.ext.skeleton }
Expand All @@ -165,19 +165,19 @@ services:
arguments:
- 'githubactions'
- false
- ['tests']
- []
- ['.github/workflows/tests.yml']
- 'TEST_DEPLOY'
tags:
- { name: phpbb.skeleton.ext.skeleton }

phpbb.skeleton.ext.skeleton.travis:
phpbb.skeleton.ext.skeleton.githubactions_custom:
class: phpbb\skeleton\skeleton
arguments:
- 'travis'
- 'githubactions_custom'
- false
- ['tests']
- ['travis/prepare-phpbb.sh', '.travis.yml']
- []
- ['.github/workflows/tests.yml']
- 'TEST_DEPLOY'
tags:
- { name: phpbb.skeleton.ext.skeleton }
Expand Down
2 changes: 1 addition & 1 deletion helper/packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function get_component_dialog_values()
$components[$service->get_name()] = [
'default' => $service->get_default(),
'dependencies' => $service->get_dependencies(),
'files' => $service->get_files(),
'files' => $service->get_files(),
'group' => $service->get_group(),
];
}
Expand Down
17 changes: 9 additions & 8 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
$lang = array_merge($lang, [
'CLI_DESCRIPTION_SKELETON_CREATE' => 'Create a basic skeleton extension',
'PHPBB_SKELETON_EXT' => 'Skeleton Extension',
'PHPBB_CREATE_SKELETON_EXT' => 'Create skeleton extension',
'PHPBB_SKELETON_EXT_DOCS' => 'Read the Documentation',
'PHPBB_CREATE_SKELETON_EXT' => 'Create a Skeleton Extension',
'PHPBB_CREATE_SKELETON_EXPLAIN' => 'Generate your extension’s foundation in seconds. No more setting up files by hand — Skeleton builds it all for you, with clean, fully documented templates based on phpBB’s best practices. Before you begin, be sure to review the 📖 [<a href="%1$s" target="_blank">Skeleton Extension Documentation</a>], 🛡️ [<a href="%2$s" target="_blank">Extension Validation Rules</a>], and 🛠️ [<a href="%3$s" target="_blank">Coding Guidelines</a>].',
'PHPBB_SKELETON_EXT_HELP' => 'Learn More',

'EXTENSION_CLI_SKELETON_SUCCESS' => "<info>Extension created successfully.\nCopy the extension from `store/tmp-ext/` into the `ext/` folder.</info>",
'SKELETON_CLI_COMPOSER_QUESTIONS' => '<comment>Enter composer.json details (hit enter to leave an option empty)</comment>',
Expand Down Expand Up @@ -119,12 +120,12 @@
'SKELETON_QUESTION_COMPONENT_TESTS' => 'Create sample PHPUnit tests?',
'SKELETON_QUESTION_COMPONENT_TESTS_UI' => 'Tests (PHPUnit)',
'SKELETON_QUESTION_COMPONENT_TESTS_EXPLAIN' => 'Unit tests can test an extension to verify that specific portions of its source code work properly. This helps ensure basic code integrity and prevents regressions as an extension is being developed and debugged.',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS' => 'Create a workflow for test execution using Github Actions?',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_UI' => 'Github Actions CI configuration',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_EXPLAIN' => 'Github Actions allow you to run PHPUnit tests on your GitHub repository. This will generate the workflow YML needed to begin testing your phpBB extension with each commit and pull request. Note that this workflow will be inside a hidden folder (.github/workflows).',
'SKELETON_QUESTION_COMPONENT_TRAVIS' => 'Create a sample for test execution on Travis CI?',
'SKELETON_QUESTION_COMPONENT_TRAVIS_UI' => 'Travis CI configuration',
'SKELETON_QUESTION_COMPONENT_TRAVIS_EXPLAIN' => 'Travis CI is a platform for running your PHPUnit tests on a GitHub repository. This will generate the basic config and script files needed to begin testing your phpBB extension with each commit and pull request.',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS' => 'Create a GitHub Actions workflow to run tests in your repository?',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_UI' => 'Github Actions workflow',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_EXPLAIN' => 'Creates a GitHub Actions workflow to run PHPUnit tests on your repository using a framework maintained by phpBB. The workflow YML file will be placed in the .github/workflows folder and will run tests automatically on each commit and pull request.',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM' => 'Create a fully customisable GitHub Actions workflow? (Select this if you plan to modify jobs or steps.)',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM_UI' => 'Github Actions custom workflow',
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM_EXPLAIN' => 'Creates a customisable GitHub Actions workflow to run PHPUnit tests on your repository. This workflow is flexible to fit your specific testing needs and will be saved in the .github/workflows folder, triggered by each commit and pull request. Choosing this will override the non-customisable workflow.',
'SKELETON_QUESTION_COMPONENT_BUILD' => 'Create a sample build script for phing?',
'SKELETON_QUESTION_COMPONENT_BUILD_UI' => 'Build script (phing)',
'SKELETON_QUESTION_COMPONENT_BUILD_EXPLAIN' => 'A phing build script is generated for your extension which can be used to generate build packages to help simplify the release or deployment processes.',
Expand Down
38 changes: 35 additions & 3 deletions skeleton/.github/workflows/tests.yml.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Tests

{% if COMPONENT.githubactions_custom %}
env:
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }} # Your extension vendor/package name
SNIFF: 1 # Run code sniffer on your code? 1 or 0
Expand Down Expand Up @@ -336,9 +337,9 @@ jobs:
- php: '7.2'
db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04"
db_alias: 'MSSQL 2019'
- php: '7.2'
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
db_alias: 'MSSQL 2022'
- php: '7.2'
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
db_alias: 'MSSQL 2022'

name: PHP ${{ '{{' }} matrix.php }} - ${{ '{{' }} matrix.db_alias != '' && matrix.db_alias || matrix.db }}

Expand Down Expand Up @@ -424,3 +425,34 @@ jobs:
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
working-directory: ./phpBB3
# END Other Tests Job
{% else %}
on:
push:
branches: # Run tests when commits are pushed to these branches in your repo
- main
- master
- develop
- dev/*
pull_request: # Run tests when pull requests are made on these branches in your repo
branches:
- main
- master
- develop
- dev/*

jobs:
call-tests:
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
with:
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }} # Your extension vendor/package name
SNIFF: 1 # Run code sniffer on your code? 1 or 0
IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0
EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0
EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0
CODECOV: 0 # Run code coverage via codecov? 1 or 0
PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on
secrets:
CODECOV_TOKEN: ${{ '{{' }} secrets.CODECOV_TOKEN }} # Do not change this

# See the README for full details and setup instructions: https://github.com/phpbb-extensions/test-framework
{% endif %}
179 changes: 0 additions & 179 deletions skeleton/.travis.yml.twig

This file was deleted.

7 changes: 5 additions & 2 deletions skeleton/README.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Go to "ACP" > "Customise" > "Extensions" and enable the "{{ EXTENSION.extension_
{% if COMPONENT.tests %}
## Tests and Continuous Integration

We use {% if COMPONENT.githubactions %}Github Actions {% endif %}{% if COMPONENT.githubactions and COMPONENT.travis %}and {% endif %}{% if COMPONENT.travis %}Travis-CI {% endif %}as a continuous integration server and phpunit for our unit testing. See more information on the [phpBB Developer Docs](https://area51.phpbb.com/docs/dev/master/testing/index.html).
To run the tests locally, you need to install phpBB from its Git repository. Afterwards run the following command from the phpBB Git repository's root:
{% if COMPONENT.githubactions %}We use GitHub Actions as a continuous integration server and phpunit for our unit testing..{% endif %}
To run the tests locally, you need to install phpBB from its Git repository. Afterward run the following command from the phpBB Git repository's root:

Windows:

Expand All @@ -20,6 +20,9 @@ others:

phpBB/vendor/bin/phpunit -c phpBB/ext/{{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }}/phpunit.xml.dist


See more information on the [phpBB Developer Docs](https://area51.phpbb.com/docs/dev/master/testing/index.html)

{% endif %}
## License

Expand Down
2 changes: 0 additions & 2 deletions skeleton/build.xml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
-->
<delete dir="{{ dir }}/.github" />
<delete dir="{{ dir }}/tests" />
<delete dir="{{ dir }}/travis" />

<delete file="{{ dir }}/.gitignore" />
<delete file="{{ dir }}/.gitattributes" />
<delete file="{{ dir }}/.travis.yml" />
<delete file="{{ dir }}/build.xml" />
<delete file="{{ dir }}/composer.lock" />
<delete file="{{ dir }}/composer.phar" />
Expand Down
22 changes: 0 additions & 22 deletions skeleton/travis/prepare-phpbb.sh.twig

This file was deleted.

Loading