Skip to content

Commit b1d6dce

Browse files
authored
Merge pull request #152 from iMattPro/update
Update Github Actions workflow
2 parents 88c2456 + dffccd1 commit b1d6dce

File tree

12 files changed

+85
-230
lines changed

12 files changed

+85
-230
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/tests/ export-ignore
2-
/travis/ export-ignore
32
.github/ export-ignore
4-
.travis.yml export-ignore
53
.gitignore export-ignore
64
.gitattributes export-ignore
75
phpunit.xml.dist export-ignore

build.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
-->
1616
<delete dir="${dir}/.github" />
1717
<delete dir="${dir}/tests" />
18-
<delete dir="${dir}/travis" />
1918

2019
<delete file="${dir}/.gitignore" />
21-
<delete file="${dir}/.travis.yml" />
2220
<delete file="${dir}/build.xml" />
2321
<delete file="${dir}/composer.lock" />
2422
<delete file="${dir}/composer.phar" />

config/skeletons.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ services:
155155
- 'tests'
156156
- false
157157
- []
158-
- ['tests/controller/main_test.php', 'tests/dbal/fixtures/config.xml', 'tests/dbal/simple_test.php', 'tests/functional/view_test.php', 'phpunit.xml.dist']
158+
- ['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']
159159
- 'TEST_DEPLOY'
160160
tags:
161161
- { name: phpbb.skeleton.ext.skeleton }
@@ -165,19 +165,19 @@ services:
165165
arguments:
166166
- 'githubactions'
167167
- false
168-
- ['tests']
168+
- []
169169
- ['.github/workflows/tests.yml']
170170
- 'TEST_DEPLOY'
171171
tags:
172172
- { name: phpbb.skeleton.ext.skeleton }
173173

174-
phpbb.skeleton.ext.skeleton.travis:
174+
phpbb.skeleton.ext.skeleton.githubactions_custom:
175175
class: phpbb\skeleton\skeleton
176176
arguments:
177-
- 'travis'
177+
- 'githubactions_custom'
178178
- false
179-
- ['tests']
180-
- ['travis/prepare-phpbb.sh', '.travis.yml']
179+
- []
180+
- ['.github/workflows/tests.yml']
181181
- 'TEST_DEPLOY'
182182
tags:
183183
- { name: phpbb.skeleton.ext.skeleton }

helper/packager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function get_component_dialog_values()
9595
$components[$service->get_name()] = [
9696
'default' => $service->get_default(),
9797
'dependencies' => $service->get_dependencies(),
98-
'files' => $service->get_files(),
98+
'files' => $service->get_files(),
9999
'group' => $service->get_group(),
100100
];
101101
}

language/en/common.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
$lang = array_merge($lang, [
2525
'CLI_DESCRIPTION_SKELETON_CREATE' => 'Create a basic skeleton extension',
2626
'PHPBB_SKELETON_EXT' => 'Skeleton Extension',
27-
'PHPBB_CREATE_SKELETON_EXT' => 'Create skeleton extension',
28-
'PHPBB_SKELETON_EXT_DOCS' => 'Read the Documentation',
27+
'PHPBB_CREATE_SKELETON_EXT' => 'Create a Skeleton Extension',
28+
'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>].',
29+
'PHPBB_SKELETON_EXT_HELP' => 'Learn More',
2930

3031
'EXTENSION_CLI_SKELETON_SUCCESS' => "<info>Extension created successfully.\nCopy the extension from `store/tmp-ext/` into the `ext/` folder.</info>",
3132
'SKELETON_CLI_COMPOSER_QUESTIONS' => '<comment>Enter composer.json details (hit enter to leave an option empty)</comment>',
@@ -119,12 +120,12 @@
119120
'SKELETON_QUESTION_COMPONENT_TESTS' => 'Create sample PHPUnit tests?',
120121
'SKELETON_QUESTION_COMPONENT_TESTS_UI' => 'Tests (PHPUnit)',
121122
'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.',
122-
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS' => 'Create a workflow for test execution using Github Actions?',
123-
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_UI' => 'Github Actions CI configuration',
124-
'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).',
125-
'SKELETON_QUESTION_COMPONENT_TRAVIS' => 'Create a sample for test execution on Travis CI?',
126-
'SKELETON_QUESTION_COMPONENT_TRAVIS_UI' => 'Travis CI configuration',
127-
'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.',
123+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS' => 'Create a GitHub Actions workflow to run tests in your repository?',
124+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_UI' => 'Github Actions workflow',
125+
'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.',
126+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM' => 'Create a fully customisable GitHub Actions workflow? (Select this if you plan to modify jobs or steps.)',
127+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM_UI' => 'Github Actions custom workflow',
128+
'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.',
128129
'SKELETON_QUESTION_COMPONENT_BUILD' => 'Create a sample build script for phing?',
129130
'SKELETON_QUESTION_COMPONENT_BUILD_UI' => 'Build script (phing)',
130131
'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.',

skeleton/.github/workflows/tests.yml.twig

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Tests
22

3+
{% if COMPONENT.githubactions_custom %}
34
env:
45
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }} # Your extension vendor/package name
56
SNIFF: 1 # Run code sniffer on your code? 1 or 0
@@ -336,9 +337,9 @@ jobs:
336337
- php: '7.2'
337338
db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04"
338339
db_alias: 'MSSQL 2019'
339-
- php: '7.2'
340-
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
341-
db_alias: 'MSSQL 2022'
340+
- php: '7.2'
341+
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
342+
db_alias: 'MSSQL 2022'
342343

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

@@ -424,3 +425,34 @@ jobs:
424425
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
425426
working-directory: ./phpBB3
426427
# END Other Tests Job
428+
{% else %}
429+
on:
430+
push:
431+
branches: # Run tests when commits are pushed to these branches in your repo
432+
- main
433+
- master
434+
- develop
435+
- dev/*
436+
pull_request: # Run tests when pull requests are made on these branches in your repo
437+
branches:
438+
- main
439+
- master
440+
- develop
441+
- dev/*
442+
443+
jobs:
444+
call-tests:
445+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
446+
with:
447+
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }} # Your extension vendor/package name
448+
SNIFF: 1 # Run code sniffer on your code? 1 or 0
449+
IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0
450+
EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0
451+
EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0
452+
CODECOV: 0 # Run code coverage via codecov? 1 or 0
453+
PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on
454+
secrets:
455+
CODECOV_TOKEN: ${{ '{{' }} secrets.CODECOV_TOKEN }} # Do not change this
456+
457+
# See the README for full details and setup instructions: https://github.com/phpbb-extensions/test-framework
458+
{% endif %}

skeleton/.travis.yml.twig

Lines changed: 0 additions & 179 deletions
This file was deleted.

skeleton/README.md.twig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Go to "ACP" > "Customise" > "Extensions" and enable the "{{ EXTENSION.extension_
99
{% if COMPONENT.tests %}
1010
## Tests and Continuous Integration
1111

12-
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).
13-
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:
12+
{% if COMPONENT.githubactions %}We use GitHub Actions as a continuous integration server and phpunit for our unit testing..{% endif %}
13+
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:
1414

1515
Windows:
1616

@@ -20,6 +20,9 @@ others:
2020

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

23+
24+
See more information on the [phpBB Developer Docs](https://area51.phpbb.com/docs/dev/master/testing/index.html)
25+
2326
{% endif %}
2427
## License
2528

skeleton/build.xml.twig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
-->
2626
<delete dir="{{ dir }}/.github" />
2727
<delete dir="{{ dir }}/tests" />
28-
<delete dir="{{ dir }}/travis" />
2928

3029
<delete file="{{ dir }}/.gitignore" />
3130
<delete file="{{ dir }}/.gitattributes" />
32-
<delete file="{{ dir }}/.travis.yml" />
3331
<delete file="{{ dir }}/build.xml" />
3432
<delete file="{{ dir }}/composer.lock" />
3533
<delete file="{{ dir }}/composer.phar" />

skeleton/travis/prepare-phpbb.sh.twig

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)