From 347618af9f29ec59f88eadaa3a975191ba217714 Mon Sep 17 00:00:00 2001 From: Greg Havekes <883845+havekes@users.noreply.github.com> Date: Wed, 5 Jun 2024 08:17:46 -0400 Subject: [PATCH 1/2] add: composer 2.7 section for ci --- continuous-integration.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/continuous-integration.md b/continuous-integration.md index 470c077..168f489 100644 --- a/continuous-integration.md +++ b/continuous-integration.md @@ -7,6 +7,13 @@ description: Up until now, we have only discussed running tests from the command Up until now, we have only discussed running tests from the command line on your local machine. But, you can also run your tests from a CI platform of your choice. As `pestphp/pest` is included in your Composer development dependencies, you can easily execute the `vendor/bin/pest` command within your CI platform's deployment pipeline. +## Composer 2.7+ caveat + +Since Composer 2.7, plugins are disabled by default when running as root, which is most often the case in the various CI platforms. +You might encounter errors such as `Unknown option "--parallel"` or `option --coverage is ambiguous`. + +To enable plugins and fix those issues, you can either setup your CI environment to use a regular user (varies by platform) or set `COMPOSER_ALLOW_SUPERUSER=1` before running `./vendor/bin/pest`. + ## Example With GitHub Actions If your application uses [GitHub Actions](https://github.com/features/actions) as its CI platform, the following guidelines will assist you in configuring Pest so that your application is automatically tested when someone pushes a commit to your GitHub repository. @@ -55,7 +62,7 @@ To get started, add the following configuration to your `.gitlab-ci.yml` file. T stages: - build - test - + build:vendors: stage: build only: @@ -70,7 +77,7 @@ build:vendors: image: composer:2 script: - composer install --no-interaction --prefer-dist --optimize-autoloader - + tests: stage: test only: From c627bdf9272be43e3f1b2e417a9d96481e98002c Mon Sep 17 00:00:00 2001 From: Greg Havekes <883845+havekes@users.noreply.github.com> Date: Wed, 5 Jun 2024 08:21:10 -0400 Subject: [PATCH 2/2] add: composer 2.7 link to issue --- continuous-integration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/continuous-integration.md b/continuous-integration.md index 168f489..f408dc6 100644 --- a/continuous-integration.md +++ b/continuous-integration.md @@ -9,7 +9,8 @@ Up until now, we have only discussed running tests from the command line on your ## Composer 2.7+ caveat -Since Composer 2.7, plugins are disabled by default when running as root, which is most often the case in the various CI platforms. +Since Composer 2.7, plugins are disabled by default when running as root, which is most often the case in the various CI platforms (read more about this change: [composer/composer#11839](https://github.com/composer/composer/issues/11839)). + You might encounter errors such as `Unknown option "--parallel"` or `option --coverage is ambiguous`. To enable plugins and fix those issues, you can either setup your CI environment to use a regular user (varies by platform) or set `COMPOSER_ALLOW_SUPERUSER=1` before running `./vendor/bin/pest`.