From 710d37b75b1b1db95fafcbfb58e759d439990595 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 20 Jun 2025 22:26:58 +0300 Subject: [PATCH] chore: Added `--no-dev` composer flag for some workflows --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 4 ++-- install.php | 29 +++++++++++++++-------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8e3c8daf8..b30a221b6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -47,7 +47,7 @@ jobs: run: composer update --no-install - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader + run: composer install --no-dev --no-progress --prefer-dist --optimize-autoloader - name: Cleanup run: php _cleanup.php && rm _cleanup.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e92dfe326..b8d53cc4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: run: composer update --no-install - name: Install Composer dependencies 🪚 - run: composer install --no-progress --prefer-dist --optimize-autoloader + run: composer install --no-dev --no-progress --prefer-dist --optimize-autoloader - name: Get commit hash 🔗 id: get-commit-hash @@ -63,7 +63,7 @@ jobs: run: composer update --no-install - name: 🖇 Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader + run: composer install --no-dev --no-progress --prefer-dist --optimize-autoloader - name: 📂 Sync files uses: SamKirkland/FTP-Deploy-Action@v4.3.5 diff --git a/install.php b/install.php index 79f88272c..0db88cba8 100644 --- a/install.php +++ b/install.php @@ -117,20 +117,6 @@ chmod_r(BB_ROOT . 'internal_data', 0755, 0644); chmod_r(BB_ROOT . 'sitemap', 0755, 0644); out("- Permissions successfully applied!\n", 'success'); -// Ask if user is a developer before installing dependencies -$isDeveloper = false; -echo "\nAre you a developer who needs testing tools and dev dependencies? [y/N]: "; -if (str_starts_with(mb_strtolower(trim(readline())), 'y')) { - $isDeveloper = true; - if (!version_compare(PHP_VERSION, '8.2.0', '>=')) { - out("- Warning: Development dependencies require PHP 8.2+, your version is " . PHP_VERSION, 'warning'); - out("- Some testing tools may not work properly", 'warning'); - } - out("- Installing all dependencies including dev tools...", 'info'); -} else { - out("- Installing production dependencies only...\n", 'info'); -} - // Check composer installation if (!is_file(BB_ROOT . 'vendor/autoload.php')) { out('- Hmm, it seems there are no Composer dependencies', 'info'); @@ -159,6 +145,21 @@ if (!is_file(BB_ROOT . 'vendor/autoload.php')) { // Installing dependencies if (is_file(BB_ROOT . 'composer.phar')) { out('- Installing dependencies...', 'info'); + + // Ask if user is a developer before installing dependencies + $isDeveloper = false; + echo "\nAre you a developer who needs testing tools and dev dependencies? [y/N]: "; + if (str_starts_with(mb_strtolower(trim(readline())), 'y')) { + $isDeveloper = true; + if (!version_compare(PHP_VERSION, '8.2.0', '>=')) { + out("- Warning: Development dependencies require PHP 8.2+, your version is " . PHP_VERSION, 'warning'); + out("- Some testing tools may not work properly", 'warning'); + } + out("- Installing all dependencies including dev tools...\n", 'info'); + } else { + out("- Installing production dependencies only...\n", 'info'); + } + runProcess('php ' . BB_ROOT . 'composer.phar update --no-install'); sleep(3);