From c85056e2bffbb79fde4033058f1183595d3e24fc Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 20 Aug 2021 11:48:52 -0700 Subject: [PATCH 01/15] Fixes for 4.0 --- helper/packager.php | 4 +--- tests/template/template_test.php | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/helper/packager.php b/helper/packager.php index 3cea2de..c8addc1 100644 --- a/helper/packager.php +++ b/helper/packager.php @@ -207,9 +207,7 @@ protected function get_template_engine() $path_helper, $this->phpbb_container->getParameter('core.cache_dir'), $this->phpbb_container->get('ext.manager'), - new loader( - new filesystem() - ) + new loader() ); // Custom filter for use by packager to decode greater/less than symbols diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 87bb425..15d926f 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -33,7 +33,6 @@ protected function setup_engine(array $new_config = array()) new \phpbb\symfony_request( new \phpbb_mock_request() ), - $filesystem, $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx @@ -43,7 +42,7 @@ protected function setup_engine(array $new_config = array()) $cache_path = $phpbb_root_path . 'cache/twig'; $context = new \phpbb\template\context(); - $loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), ''); + $loader = new \phpbb\template\twig\loader(); $twig = new \phpbb\template\twig\environment( $config, $filesystem, From eae0501d6f1b693fdb9f735f0e9e57a9ded5ac94 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 12 Oct 2021 16:13:35 -0700 Subject: [PATCH 02/15] Update Icons --- .../template/event/overall_header_navigation_prepend.html | 4 +--- styles/prosilver/template/skeleton_body.html | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/styles/prosilver/template/event/overall_header_navigation_prepend.html b/styles/prosilver/template/event/overall_header_navigation_prepend.html index 1f901fa..d2332ec 100644 --- a/styles/prosilver/template/event/overall_header_navigation_prepend.html +++ b/styles/prosilver/template/event/overall_header_navigation_prepend.html @@ -1,7 +1,5 @@
  • - - - {{ lang('PHPBB_SKELETON_EXT') }} + {{ Icon('iconify', 'mdi:tools', lang('PHPBB_SKELETON_EXT'), false, '', {'style': 'height:14px;width:14px;'}) }}
  • diff --git a/styles/prosilver/template/skeleton_body.html b/styles/prosilver/template/skeleton_body.html index 12a5cc5..5ee7ade 100644 --- a/styles/prosilver/template/skeleton_body.html +++ b/styles/prosilver/template/skeleton_body.html @@ -19,7 +19,7 @@

    {{ lang('PHPBB_CREATE_SKELETON_EXT') }}

    -

    {{ lang('PHPBB_SKELETON_EXT_DOCS') }}

    +

    {{ Icon('iconify', 'fa-solid:book-reader', lang('PHPBB_SKELETON_EXT_DOCS')) }}

    {{ lang('SKELETON_TITLE_EXTENSION_INFO') }}

    {% for extension in loops.extension %}
    From 35b14640bafa2aa8cdab9c7047360a13c2396f3d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 14 Oct 2021 16:55:08 -0700 Subject: [PATCH 03/15] Fix buttons --- styles/prosilver/template/skeleton_body.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/prosilver/template/skeleton_body.html b/styles/prosilver/template/skeleton_body.html index 5ee7ade..7feb981 100644 --- a/styles/prosilver/template/skeleton_body.html +++ b/styles/prosilver/template/skeleton_body.html @@ -55,7 +55,7 @@

    {{ lang('SKELETON_TITLE_AUTHOR_INFO') }}

    {% endfor %}
    - +
    @@ -98,7 +98,7 @@

    {{ lang('SKELETON_COMPONENT_GROUP_' ~ group) }}<
    {{ S_HIDDEN_FIELDS }} - +
    From 474210f43f5c5a543ccda5250d4523632ba7dee5 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 14 Oct 2021 16:55:25 -0700 Subject: [PATCH 04/15] Use iconify in skeleton templates --- .../event/overall_header_navigation_prepend.html.twig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig b/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig index d9183e1..aeabedd 100644 --- a/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig +++ b/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig @@ -1,9 +1,15 @@ {% if skeleton_version_compare(REQUIREMENTS.phpbb_version_min, "3.2", "<") %}{# for phpBB 3.1.x #}
  • {{ '{{' }} lang('{{ EXTENSION.extension_name|upper }}_PAGE') }}
  • -{% else %}{# for phpBB > 3.2.x #} +{% elseif skeleton_version_compare(REQUIREMENTS.phpbb_version_min, "4.0", "<") %}{# for phpBB 3.2.x - 3.3.x #}
  • {{ '{{' }} lang('{{ EXTENSION.extension_name|upper }}_PAGE') }}
  • +{% else %}{# for phpBB > 4.0.x #} +
  • + + {{ '{{' }} Icon('iconify', 'fa:question-circle', lang('{{ EXTENSION.extension_name|upper }}_PAGE'), false) }} + +
  • {% endif %} From 24248cec207c19e0876199eec5aa8cf82419d8df Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 15 Oct 2021 09:39:02 -0700 Subject: [PATCH 05/15] Update phpunit config --- phpunit.xml.dist | 44 +++++++++++++++++----------------- skeleton/phpunit.xml.dist.twig | 37 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 22 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 574c6b9..cd8d13a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,27 @@ - - + + + ./ + + + ./language/ + ./migrations/ + ./tests/ + + ./tests @@ -20,15 +31,4 @@ ./tests/functional/ - - - - ./ - - ./language/ - ./migrations/ - ./tests/ - - - diff --git a/skeleton/phpunit.xml.dist.twig b/skeleton/phpunit.xml.dist.twig index e40aa26..c2368ef 100644 --- a/skeleton/phpunit.xml.dist.twig +++ b/skeleton/phpunit.xml.dist.twig @@ -1,3 +1,4 @@ +{% if skeleton_version_compare(REQUIREMENTS.phpbb_version_max, "4.0", "<") %} +{% else %} + + + + + ./ + + + ./language/ + ./migrations/ + ./tests/ + + + + + ./tests + ./tests/functional + + + ./tests/functional/ + + + +{% endif %} From 5dfcf60835c87cdc17473f8e6cb114059a15031a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 20 Oct 2021 15:37:13 -0700 Subject: [PATCH 06/15] Update tests --- tests/console/create_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/console/create_test.php b/tests/console/create_test.php index a9963b3..d86de0c 100644 --- a/tests/console/create_test.php +++ b/tests/console/create_test.php @@ -138,7 +138,7 @@ public function get_command_tester($question_answers = []): CommandTester return $response; }; $helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\QuestionHelper') - ->setMethods(['ask']) + ->onlyMethods(['ask']) ->disableOriginalConstructor() ->getMock(); $helper->method('ask') From 474679dca17551dd9a9327692015aa262b58b0af Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 20 Feb 2023 13:48:00 -0800 Subject: [PATCH 07/15] Use Command constants Signed-off-by: Matt Friedman # Conflicts: # console/create.php --- console/create.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/console/create.php b/console/create.php index a1789e1..aaf9b80 100644 --- a/console/create.php +++ b/console/create.php @@ -18,6 +18,7 @@ use phpbb\skeleton\helper\packager; use phpbb\skeleton\helper\validator; use phpbb\user; +use Symfony\Component\Console\Command\Command as SymfonyCommand; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -92,6 +93,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->packager->create_extension($this->data); $output->writeln($this->language->lang('EXTENSION_CLI_SKELETON_SUCCESS')); + + return SymfonyCommand::SUCCESS; } /** From e261f9a12097daaf0102e48aebea31f9cf7d792a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 14 Feb 2024 11:51:12 -0800 Subject: [PATCH 08/15] Remove iconify Signed-off-by: Matt Friedman --- .../template/event/overall_header_navigation_prepend.html.twig | 2 +- .../template/event/overall_header_navigation_prepend.html | 2 +- styles/prosilver/template/skeleton_body.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig b/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig index aeabedd..a3e8089 100644 --- a/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig +++ b/skeleton/styles/prosilver/template/event/overall_header_navigation_prepend.html.twig @@ -9,7 +9,7 @@ {% else %}{# for phpBB > 4.0.x #}
  • - {{ '{{' }} Icon('iconify', 'fa:question-circle', lang('{{ EXTENSION.extension_name|upper }}_PAGE'), false) }} + {{ '{{' }} Icon('font', 'circle-question', lang('{{ EXTENSION.extension_name|upper }}_PAGE'), false, 'fas') }}
  • {% endif %} diff --git a/styles/prosilver/template/event/overall_header_navigation_prepend.html b/styles/prosilver/template/event/overall_header_navigation_prepend.html index 87dccd1..d645473 100644 --- a/styles/prosilver/template/event/overall_header_navigation_prepend.html +++ b/styles/prosilver/template/event/overall_header_navigation_prepend.html @@ -1,5 +1,5 @@
  • - {{ Icon('iconify', 'mdi:skull', lang('PHPBB_SKELETON_EXT'), false, '', {'style': 'height:14px;width:14px;'}) }} + {{ Icon('font', 'skull', lang('PHPBB_SKELETON_EXT'), false, 'fas', {'style': 'height:14px;width:14px;'}) }}
  • diff --git a/styles/prosilver/template/skeleton_body.html b/styles/prosilver/template/skeleton_body.html index 7feb981..9df544b 100644 --- a/styles/prosilver/template/skeleton_body.html +++ b/styles/prosilver/template/skeleton_body.html @@ -19,7 +19,7 @@

    {{ lang('PHPBB_CREATE_SKELETON_EXT') }}

    -

    {{ Icon('iconify', 'fa-solid:book-reader', lang('PHPBB_SKELETON_EXT_DOCS')) }}

    +

    {{ Icon('font', 'book-open', lang('PHPBB_SKELETON_EXT_DOCS'), false, 'fas') }}

    {{ lang('SKELETON_TITLE_EXTENSION_INFO') }}

    {% for extension in loops.extension %}
    From a8b2e274be7ba647e419820d2635d145af10e885 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 12 Jun 2024 10:42:44 -0700 Subject: [PATCH 09/15] Set phpBB4 version constraints Signed-off-by: Matt Friedman --- composer.json | 6 +- composer.lock | 160 +++++++++++++++++++++++++++++++++++++++-- ext.php | 13 ++-- language/en/common.php | 5 +- 4 files changed, 165 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 04d12c9..5652e9e 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "phpbb-extension", "description": "The official phpBB skeleton extension generator.", "homepage": "https://www.phpbb.com/customise/db/official_tool/ext_skeleton/", - "version": "1.1.12-dev", + "version": "1.2.0-dev", "license": "GPL-2.0-only", "authors": [ { @@ -19,7 +19,7 @@ } ], "require": { - "php": ">=5.6", + "php": ">=8.1", "composer/installers": "~1.0" }, "require-dev": { @@ -28,7 +28,7 @@ "extra": { "display-name": "phpBB Skeleton Extension", "soft-require": { - "phpbb/phpbb": ">=3.2.3,<4.0.0@dev" + "phpbb/phpbb": ">=4.0.0@dev" }, "version-check": { "host": "www.phpbb.com", diff --git a/composer.lock b/composer.lock index 336bc59..5208588 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,160 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cc528df5b57423e40c915b49a9287abc", - "packages": [], + "content-hash": "f2ddede31d35e9a55d7d62efd6b8f235", + "packages": [ + { + "name": "composer/installers", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.3" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "tastyigniter", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.12.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-09-13T08:19:44+00:00" + } + ], "packages-dev": [ { "name": "phing/phing", @@ -70,8 +222,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6" + "php": ">=8.1" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.6.0" } diff --git a/ext.php b/ext.php index 286023e..51df532 100644 --- a/ext.php +++ b/ext.php @@ -46,25 +46,20 @@ public function is_enableable() */ protected function phpbb_requirement() { - if (phpbb_version_compare(PHPBB_VERSION, '3.2.3', '<')) + if (phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<')) { - $this->errors[] = 'PHPBB_VERSION_MIN_ERROR'; - } - - else if (phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '>=')) - { - $this->errors[] = 'PHPBB_VERSION_MAX_ERROR'; + $this->errors[] = 'PHPBB_VERSION_ERROR'; } } /** - * Check PHP 5.6.0 minimum requirement. + * Check PHP 8.1 minimum requirement. * * @return void */ protected function php_requirement() { - if (phpbb_version_compare(PHP_VERSION, '5.6.0', '<')) + if (PHP_VERSION_ID < 80100) { $this->errors[] = 'PHP_VERSION_ERROR'; } diff --git a/language/en/common.php b/language/en/common.php index b1b6758..2f5cb5e 100644 --- a/language/en/common.php +++ b/language/en/common.php @@ -155,7 +155,6 @@ 'SKELETON_INVALID_PHPBB_MAX_VERSION'=> 'The maximum phpBB version requirement is invalid.', 'NO_ZIPARCHIVE_ERROR' => 'The ZipArchive class is required, but was not found in your PHP configuration.', - 'PHP_VERSION_ERROR' => 'PHP 5.6 or newer is required to use this extension.', - 'PHPBB_VERSION_MIN_ERROR' => 'phpBB 3.2.3 or newer is required to use this extension.', - 'PHPBB_VERSION_MAX_ERROR' => 'phpBB 4 is not supported with this version of the extension. Please check for a newer version of this extension.' + 'PHP_VERSION_ERROR' => 'PHP 8.1 or newer is required to use this extension.', + 'PHPBB_VERSION_ERROR' => 'phpBB 4.0.0-dev or newer is required to use this extension.', ]); From dfc3c69c0fd72049e20fbc9decfa7da11298c20c Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 12 Jun 2024 10:49:54 -0700 Subject: [PATCH 10/15] Update test env. Signed-off-by: Matt Friedman --- .github/workflows/tests.yml | 113 +++++++++++++++++------------------- 1 file changed, 54 insertions(+), 59 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a168a1b..01d2f66 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,9 +4,9 @@ env: EXTNAME: phpbb/skeleton # 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 + EPV: 0 # Run EPV (Extension Pre Validator) on your code? 1 or 0 EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 - PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on + PHPBB_BRANCH: master # The phpBB branch to run tests on on: push: @@ -21,12 +21,12 @@ on: jobs: # START Basic Checks Job (EPV, code sniffer, images check, etc.) basic-checks: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: include: - - php: '7.2' - db: "none" + - db: 'none' + php: '8.1' NOTESTS: 1 name: PHP ${{ matrix.php }} - ${{ matrix.db }} @@ -48,7 +48,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap + extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv coverage: none - name: Setup environment for phpBB @@ -89,44 +89,42 @@ jobs: # START MySQL and MariaDB Job mysql-tests: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: include: - - php: '7.2' - db: "mariadb:10.1" - - php: '7.2' + - php: '8.1' db: "mariadb:10.2" - - php: '7.2' + - php: '8.1' db: "mariadb:10.3" - - php: '7.2' + - php: '8.1' db: "mariadb:10.4" - - php: '7.2' - db: "mariadb:10.5" - - php: '7.2' - db: "mysql:5.6" + - php: '8.1' + db: "mariadb:10.6" + - php: '8.1' + db: "mariadb:10.9" + - php: '8.1' + db: "mariadb:10.10" + - php: '8.1' + db: "mariadb:10.11" + - php: '8.1' + db: "mysql:5.7" db_alias: "MyISAM Tests" MYISAM: 1 - - php: '7.2' - db: "mysql:5.6" - - php: '7.2' - db: "mysql:5.7" - COVERAGE: 1 - db_alias: "mysql:5.7 with Coverage" - - php: '7.3' - db: "mysql:5.7" - - php: '7.4' - db: "mysql:5.7" - - php: '7.4' + - php: '8.1' db: "mysql:8.0" - - php: '8.0' - db: "mysql:5.7" + COVERAGE: 1 + db_alias: "mysql:8.0 with Coverage" - php: '8.1' - db: "mysql:5.7" + db: "mysql:8.1" - php: '8.2' - db: "mysql:5.7" + db: "mysql:8.0" + - php: '8.2' + db: "mariadb:10.2" - php: '8.3' db: "mysql:5.7" + - php: '8.3' + db: "mariadb:10.2" name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} @@ -179,7 +177,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap + extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap coverage: none - name: Setup PHP with Coverage @@ -187,7 +185,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap + extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap coverage: xdebug - name: Setup environment for phpBB @@ -240,42 +238,36 @@ jobs: # START PostgreSQL Job postgres-tests: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: include: - - php: '7.2' + - php: '8.1' db: "postgres:9.5" - - php: '7.2' + - php: '8.1' db: "postgres:9.6" - - php: '7.2' + - php: '8.1' db: "postgres:10" - - php: '7.2' + - php: '8.1' db: "postgres:11" - - php: '7.2' - db: "postgres:12" - - php: '7.2' - db: "postgres:13" - - php: '7.3' - db: "postgres:13" - - php: '7.4' - db: "postgres:13" - - php: '8.0' + - php: '8.1' db: "postgres:12" - - php: '8.0' + - php: '8.1' db: "postgres:13" - php: '8.1' db: "postgres:14" + - php: '8.1' + db: "postgres:15" - php: '8.2' - db: "postgres:14" + db: "postgres:9.5" - php: '8.3' - db: "postgres:14" + db: "postgres:9.5" name: PHP ${{ matrix.php }} - ${{ matrix.db }} services: postgres: - image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && 'postgres:10' || matrix.db }} + image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }} env: POSTGRES_HOST: localhost POSTGRES_USER: postgres @@ -323,7 +315,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap + extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, pgsql, pdo, pdo_pgsql coverage: none - name: Setup environment for phpBB @@ -354,24 +346,27 @@ jobs: # START Other Tests Job (SQLite 3 and mssql) other-tests: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: include: - - php: '7.2' + - php: '8.1' db: "sqlite3" - - php: '7.2' + - php: '8.1' db: "mcr.microsoft.com/mssql/server:2017-latest" db_alias: 'MSSQL 2017' - - php: '7.2' + - php: '8.1' db: "mcr.microsoft.com/mssql/server:2019-latest" db_alias: 'MSSQL 2019' + - php: '8.1' + db: "mcr.microsoft.com/mssql/server:2022-latest" + db_alias: 'MSSQL 2022' name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} services: mssql: - image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} + image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} env: SA_PASSWORD: "Pssw0rd_12" ACCEPT_EULA: "y" @@ -411,7 +406,7 @@ jobs: env: MATRIX_DB: ${{ matrix.db }} run: | - if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] + if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-latest' ] then db='mssql' else @@ -423,7 +418,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap + extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, sqlsrv, pdo, pdo_sqlsrv coverage: none - name: Setup environment for phpBB From 08ed421c21b2396fc769b15846f50c828cb0328e Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 10 Apr 2025 21:22:31 -0700 Subject: [PATCH 11/15] Fix tests --- tests/template/template_test.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/template/template_test.php b/tests/template/template_test.php index bfff3aa..e9a8bc7 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -46,7 +46,9 @@ protected function setup_engine(array $new_config = array()) $cache_path = $phpbb_root_path . 'cache/twig'; $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader(); + $assets_bag = new \phpbb\template\assets_bag(); $twig = new \phpbb\template\twig\environment( + $assets_bag, $config, $filesystem, $path_helper, From 4712642f8e1ff2b63c0df1735ab6b55f33b39933 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 11 Apr 2025 07:26:41 -0700 Subject: [PATCH 12/15] Fix tests --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c5a26d2..fa93a38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,15 +6,17 @@ env: IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0 EPV: 0 # Run EPV (Extension Pre Validator) on your code? 1 or 0 EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 - PHPBB_BRANCH: master # The phpBB branch to run tests on + PHPBB_BRANCH: master # The phpBB branch to run tests on on: push: branches: # Run tests when commits are pushed to these branches in your repo + - main - master - develop pull_request: # Run tests when pull requests are made on these branches in your repo branches: + - main - master - develop @@ -189,7 +191,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap coverage: xdebug - name: Setup environment for phpBB From 91d979c5c638490131c12c64dc56be3a5ed11b8a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 13 Apr 2025 09:22:56 -0700 Subject: [PATCH 13/15] Update composer lock --- composer.json | 5 +++++ composer.lock | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6e6c709..edb8f38 100644 --- a/composer.json +++ b/composer.json @@ -36,5 +36,10 @@ "filename": "version_check", "ssl": true } + }, + "config": { + "allow-plugins": { + "composer/installers": true + } } } diff --git a/composer.lock b/composer.lock index 5208588..791ccbf 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2ddede31d35e9a55d7d62efd6b8f235", + "content-hash": "020b66f81248fc66d1b48e0385f457ee", "packages": [ { "name": "composer/installers", @@ -225,5 +225,5 @@ "php": ">=8.1" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.2.0" } From 4c9ba50545151fe72bcbbde8e92564dbbb30c374 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 16 Apr 2025 08:09:52 -0700 Subject: [PATCH 14/15] Use centralized test framework --- .github/workflows/tests.yml | 452 +----------------------------------- 1 file changed, 11 insertions(+), 441 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa93a38..f22468e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,456 +1,26 @@ name: Tests -env: - EXTNAME: phpbb/skeleton # 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: 0 # Run EPV (Extension Pre Validator) on your code? 1 or 0 - EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 - PHPBB_BRANCH: master # The phpBB branch to run tests on - 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: - # START Basic Checks Job (EPV, code sniffer, images check, etc.) - basic-checks: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - db: 'none' - php: '8.1' - NOTESTS: 1 - - name: PHP ${{ matrix.php }} - ${{ matrix.db }} - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{ matrix.db }} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '1' - run: .github/setup-phpbb.sh $DB $PHP_VERSION $NOTESTS - working-directory: ./phpBB3 - - - name: Setup EPV - if: ${{ env.EPV != 0 }} - run: composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs - working-directory: ./phpBB3/phpBB - - - name: Run code sniffer - if: ${{ env.SNIFF != 0 }} - env: - NOTESTS: '1' - run: .github/ext-sniff.sh $EXTNAME $NOTESTS - working-directory: ./phpBB3 - - - name: Check image ICC profiles - if: ${{ env.IMAGE_ICC != 0 }} - run: .github/check-image-icc-profiles.sh - working-directory: ./phpBB3 - - - name: Check executable files - if: ${{ env.EXECUTABLE_FILES != 0 }} - run: .github/ext-check-executable-files.sh ./ $EXTNAME - working-directory: ./phpBB3 - - - name: Run EPV - if: ${{ env.EPV != 0 }} - run: phpBB/vendor/bin/EPV.php run --dir="phpBB/ext/$EXTNAME/" - working-directory: ./phpBB3 - # END Basic Checks Job - - # START MySQL and MariaDB Job - mysql-tests: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - php: '8.1' - db: "mariadb:10.2" - - php: '8.1' - db: "mariadb:10.3" - - php: '8.1' - db: "mariadb:10.4" - - php: '8.1' - db: "mariadb:10.6" - - php: '8.1' - db: "mariadb:10.9" - - php: '8.1' - db: "mariadb:10.10" - - php: '8.1' - db: "mariadb:10.11" - - php: '8.1' - db: "mysql:5.7" - db_alias: "MyISAM Tests" - MYISAM: 1 - - php: '8.1' - db: "mysql:8.0" - COVERAGE: 1 - db_alias: "mysql:8.0 with Coverage" - - php: '8.1' - db: "mysql:8.1" - - php: '8.2' - db: "mysql:8.0" - - php: '8.2' - db: "mariadb:10.2" - - php: '8.3' - db: "mysql:5.7" - - php: '8.3' - db: "mariadb:10.2" - - php: '8.4' - db: "mysql:8.0" - - php: '8.4' - db: "mariadb:10.3" - - name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} - - services: - mysql: - image: ${{ matrix.db }} - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: phpbb_tests - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - db=$(echo "${MATRIX_DB%%:*}") - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - if: ${{ matrix.COVERAGE != 1 }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap - coverage: none - - - name: Setup PHP with Coverage - if: ${{ matrix.COVERAGE == 1 }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap - coverage: xdebug - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: ${{ matrix.MYISAM != 1 && '0' || '1' }} - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - env: - DB: ${{steps.database-type.outputs.db}} - COVERAGE: ${{ matrix.COVERAGE != 1 && '0' || '1' }} - run: | - if [ $COVERAGE == '1' ] - then - sed -n '1h;1!H;${;g;s/<\/php>/<\/php>\n\t\n\t\t\n\t\t\t..\/<\/directory>\n\t\t\t\n\t\t\t\t..\/tests\/<\/directory>\n\t\t\t\t..\/language\/<\/directory>\n\t\t\t\t..\/migrations\/<\/directory>\n\t\t\t<\/exclude>\n\t\t<\/whitelist>\n\t<\/filter>/g;p;}' .github/phpunit-$DB-github.xml &> phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml - else - mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - fi - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - COVERAGE: ${{ matrix.COVERAGE != 1 && '0' || '1' }} - run: | - if [ $COVERAGE == '1' ] - then - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml - else - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - fi - working-directory: ./phpBB3 - - - name: Send code coverage - if: ${{ matrix.COVERAGE == 1 }} - uses: codecov/codecov-action@v3 - with: - files: ./phpBB3/build/logs/clover.xml - # END MySQL and MariaDB Job - - # START PostgreSQL Job - postgres-tests: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - php: '8.1' - db: "postgres:9.5" - - php: '8.1' - db: "postgres:9.6" - - php: '8.1' - db: "postgres:10" - - php: '8.1' - db: "postgres:11" - - php: '8.1' - db: "postgres:12" - - php: '8.1' - db: "postgres:13" - - php: '8.1' - db: "postgres:14" - - php: '8.1' - db: "postgres:15" - - php: '8.2' - db: "postgres:9.5" - - php: '8.3' - db: "postgres:9.5" - - php: '8.4' - db: "postgres:9.5" - - name: PHP ${{ matrix.php }} - ${{ matrix.db }} - - services: - postgres: - image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }} - env: - POSTGRES_HOST: localhost - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - ports: - - 5432:5432 - options: >- - -v /var/run/postgresql:/var/run/postgresql - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - db=$(echo "${MATRIX_DB%%:*}") - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, pgsql, pdo, pdo_pgsql - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: '0' - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - working-directory: ./phpBB3 - # END PostgreSQL Job - - # START Other Tests Job (SQLite 3 and mssql) - other-tests: - runs-on: ubuntu-20.04 - strategy: - matrix: - include: - - php: '8.1' - db: "sqlite3" - - php: '8.1' - db: "mcr.microsoft.com/mssql/server:2017-latest" - db_alias: 'MSSQL 2017' - - php: '8.1' - db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04" - db_alias: 'MSSQL 2019' - - php: '8.1' - 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 }} - - services: - mssql: - image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} - env: - SA_PASSWORD: "Pssw0rd_12" - ACCEPT_EULA: "y" - ports: - - 1433:1433 - options: >- - --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Pssw0rd_12' -Q \"Use [master]; CREATE DATABASE [phpbb_tests] COLLATE Latin1_General_CI_AS\" || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - --health-start-period 10s - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ] - then - db='mssql' - else - db=$(echo "${MATRIX_DB%%:*}") - fi - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, sqlsrv, pdo, pdo_sqlsrv - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: '0' - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - 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 + call-tests: + uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master + with: + EXTNAME: phpbb/skeleton # 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: 0 # Run EPV (Extension Pre Validator) on your code? 1 or 0 + EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 + PHPBB_BRANCH: master # The phpBB branch to run tests on From 11e98fe6baba025736c83407124e1c72e97804ca Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sat, 19 Apr 2025 15:13:27 -0700 Subject: [PATCH 15/15] Add codecov stuff --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f22468e..9b5725d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,4 +23,7 @@ jobs: IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0 EPV: 0 # Run EPV (Extension Pre Validator) on your code? 1 or 0 EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 + CODECOV: 1 # Run code coverage via codecov? 1 or 0 PHPBB_BRANCH: master # The phpBB branch to run tests on + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Do not change this