Skip to content

Commit e06c67f

Browse files
authored
Merge pull request #156 from iMattPro/update
Update test workflow skeleton generates
2 parents ec43207 + 0f3ba0b commit e06c67f

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

language/en/common.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@
121121
'SKELETON_QUESTION_COMPONENT_TESTS_UI' => 'Tests (PHPUnit)',
122122
'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.',
123123
'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.',
124+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_UI' => 'GitHub Actions Workflow (Reusable – Recommended)',
125+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_EXPLAIN' => 'Creates a GitHub Actions workflow that uses a reusable, phpBB-maintained framework to run PHPUnit tests on your repository. The workflow file is saved in .github/workflows and runs automatically on each commit and pull request.',
126126
'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.',
127+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM_UI' => 'GitHub Actions Workflow (Standalone – Deprecated)',
128+
'SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CUSTOM_EXPLAIN' => 'Deprecated: Creates a fully standalone workflow to run PHPUnit tests without using the shared phpBB framework. This overrides the reusable workflow and is no longer recommended. The file is saved in .github/workflows and runs on each commit and pull request.',
129129
'SKELETON_QUESTION_COMPONENT_BUILD' => 'Create a sample build script for phing?',
130130
'SKELETON_QUESTION_COMPONENT_BUILD_UI' => 'Build script (phing)',
131131
'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: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -426,26 +426,38 @@ jobs:
426426
working-directory: ./phpBB3
427427
# END Other Tests Job
428428
{% else %}
429+
# For most extensions, this workflow should not need changing;
430+
# simply commit it to your repository.
431+
#
432+
# See the README for full details and configuration instructions:
433+
# - https://github.com/phpbb-extensions/test-framework
434+
#
429435
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/*
436+
push:
437+
# Run tests when commits are pushed to these branches in your repo,
438+
# or remove this branches section to run tests on all your branches
439+
branches:
440+
- main # Main production branch
441+
- master # Legacy or alternative main branch
442+
- dev/* # Any feature branches under "dev/", e.g., dev/new-feature
443+
- release-* # Any release branches under "release-", e.g., release-1.0.0
444+
445+
pull_request:
446+
# Run tests when pull requests are made on these branches in your repo,
447+
# or remove this branches section to run tests on all your branches
448+
branches:
449+
- main
450+
- master
451+
- dev/*
442452

443453
jobs:
444-
call-tests:
445-
name: Extension tests
446-
uses: phpbb-extensions/test-framework/.github/workflows/[email protected]
447-
with:
448-
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }} # Your extension vendor/package name
449-
450-
# See the README for full details and setup instructions: https://github.com/phpbb-extensions/test-framework
454+
call-tests:
455+
name: Extension tests
456+
# Set the phpBB branch to test your extension with after the @ symbol
457+
# - 3.3.x: Targets the phpBB 3.3.x release line
458+
# - master: Targets the latest development version of phpBB (master branch)
459+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@{{ skeleton_version_compare(REQUIREMENTS.phpbb_version_min, "4.0", "<") ? '3.3.x' : 'master' }}
460+
with:
461+
# Your extension vendor/package name
462+
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }}
451463
{% endif %}

0 commit comments

Comments
 (0)