diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 201a713d..f58b135b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -37,6 +37,18 @@ $ php composer.phar install > - Edit the `scss/qi_bootstrap.scss` file to customise Bootstrap variables. > - Run `$ npm run all` to compile and deploy new Bootstrap CSS/JS files to QuickInstall. +### CLI tests + +The new CLI test suite uses an isolated Composer config so it can require PHPUnit without changing QuickInstall's legacy runtime dependency constraints. + +``` +$ cd tests +$ COMPOSER=composer.cli-tests.json composer install +$ cd .. +$ tests/vendor/bin/phpunit -c phpunit.xml.dist +``` + +The CLI test dependencies install into `tests/vendor/`, leaving the main application `vendor/` directory unchanged. ## :computer: Make something great @@ -66,4 +78,3 @@ Be prepared for: - Constructive criticism of your code changes. - phpBB team members, or the community at large may request changes to your code (repeat [step 2 from here](#computer-make-something-great)). - That feeling when your Pull Request is accepted and merged. :sunglasses: - diff --git a/.github/workflows/cli-tests.yml b/.github/workflows/cli-tests.yml new file mode 100644 index 00000000..b0df942e --- /dev/null +++ b/.github/workflows/cli-tests.yml @@ -0,0 +1,39 @@ +name: CLI tests + +on: + push: + pull_request: + +jobs: + phpunit: + name: PHPUnit PHP ${{ matrix.php }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.2', '8.3', '8.4'] + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Validate test Composer config + working-directory: tests + run: COMPOSER=composer.cli-tests.json composer validate --no-check-publish --strict + + - name: Install test dependencies + working-directory: tests + run: COMPOSER=composer.cli-tests.json composer install --no-interaction --prefer-dist + + - name: Run PHPUnit + run: tests/vendor/bin/phpunit -c phpunit.xml.dist + + - name: Lint CLI entrypoint + run: php -l bin/qi diff --git a/.gitignore b/.gitignore index 1cb62c54..ffb13102 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,13 @@ settings/* cache/* sources/* vendor/* +tests/vendor/* build/* +.qi/* +customisations/* *~ .idea node_modules +/.agents +/agent +/skills-lock.json diff --git a/README.md b/README.md index fe6d83e7..76c249e0 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,12 @@ QuickInstall is a tool we built to support the community of phpBB extension deve ## 🛠 Upgrading 1. Get the latest version of [QuickInstall](https://www.phpbb.com/customise/db/official_tool/phpbb3_quickinstall/) and extract it. -2. Copy everything into your existing QuickInstall directory **except for the 📁`boards/`, 📁`sources/` and 📁`settings/` directories**. +2. Copy everything into your existing QuickInstall directory **except for:** + - 📁`.qi/` (may be hidden by your operating system) + - 📁`boards/` + - 📁`customisations/` + - 📁`sources/` + - 📁`settings/` > If you are upgrading from QuickInstall 1.1.8 (or older) you MUST review and re-save your old Profile settings. @@ -50,6 +55,32 @@ phpBB boards require a web server running PHP and one of the following database | 3.1.x | 5.4.7 - 5.6.x | 3.23+ | 5.1+ | 8.3+ | SQLite 2 or 3 | Server 2000+ | | 3.0.x | 5.4.7 - 5.6.x | 3.23+ | - | 7.x | SQLite 2 | Server 2000 | +## QuickInstall CLI + +QuickInstall now includes a Docker-based CLI for creating local phpBB test boards. It writes generated state to `.qi/` and leaves the legacy web UI unchanged. The QuickInstall CLI requires PHP 8.0 or newer for the `php bin/qi` command. + +```bash +php bin/qi init +php bin/qi board:create test --phpbb 3.3 --db mariadb --port 8081 --populate extension-dev +php bin/qi board:start test +``` + +The QuickInstall CLI targets phpBB 3.2+ installer-based boards. phpBB 3.0/3.1 remain legacy-web-app territory and are not planned for the QuickInstall CLI. + +Downloaded extensions can be unzipped into `customisations/` and mounted into boards: + +```bash +php bin/qi ext:mount test customisations/vendor/extname +``` + +Downloaded styles can be unzipped into `customisations/` and mounted into boards: + +```bash +php bin/qi style:mount test customisations/stylename +``` + +See the complete [QuickInstall CLI docs](index.php?page=cli). + ## 🐞 Support You can receive support at the [phpBB3 QuickInstall Discussion/Support](https://www.phpbb.com/customise/db/official_tool/phpbb3_quickinstall/support) forum. diff --git a/bin/qi b/bin/qi new file mode 100755 index 00000000..dd6c3b12 --- /dev/null +++ b/bin/qi @@ -0,0 +1,26 @@ +#!/usr/bin/env php +run($argv)); diff --git a/build.xml b/build.xml index 57adc158..7d46b350 100644 --- a/build.xml +++ b/build.xml @@ -13,8 +13,10 @@ Remove some unnecessary files/directories --> + + @@ -33,6 +35,7 @@ +