Skip to content

Update test workflow skeleton generates #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025
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
8 changes: 4 additions & 4 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@
'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 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_UI' => 'GitHub Actions Workflow (Reusable – Recommended)',
'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.',
'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_GITHUBACTIONS_CUSTOM_UI' => 'GitHub Actions Workflow (Standalone – Deprecated)',
'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.',
'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
50 changes: 31 additions & 19 deletions skeleton/.github/workflows/tests.yml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -426,26 +426,38 @@ jobs:
working-directory: ./phpBB3
# END Other Tests Job
{% else %}
# For most extensions, this workflow should not need changing;
# simply commit it to your repository.
#
# See the README for full details and configuration instructions:
# - https://github.com/phpbb-extensions/test-framework
#
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/*
push:
# Run tests when commits are pushed to these branches in your repo,
# or remove this branches section to run tests on all your branches
branches:
- main # Main production branch
- master # Legacy or alternative main branch
- dev/* # Any feature branches under "dev/", e.g., dev/new-feature
- release-* # Any release branches under "release-", e.g., release-1.0.0

pull_request:
# Run tests when pull requests are made on these branches in your repo,
# or remove this branches section to run tests on all your branches
branches:
- main
- master
- dev/*

jobs:
call-tests:
name: Extension 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

# See the README for full details and setup instructions: https://github.com/phpbb-extensions/test-framework
call-tests:
name: Extension tests
# Set the phpBB branch to test your extension with after the @ symbol
# - 3.3.x: Targets the phpBB 3.3.x release line
# - master: Targets the latest development version of phpBB (master branch)
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@{{ skeleton_version_compare(REQUIREMENTS.phpbb_version_min, "4.0", "<") ? '3.3.x' : 'master' }}
with:
# Your extension vendor/package name
EXTNAME: {{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }}
{% endif %}