Monorepo: disable autoloading optimization by default (take 2) (#48980)
This PR is the second attempt to speed up monorepo installation by removing autoloading optimization setting from the configuration and performing the optimization where it is appropriate (composer post-install hooks and when building releases). In the installation context, the composer post-install hook will execute a background task to dump the optimized autoloading, while the installation process completes other tasks.
This commit is contained in:
parent
ab646ace8e
commit
7959060850
|
@ -56,12 +56,12 @@ jobs:
|
|||
bash bin/build-zip.sh
|
||||
|
||||
mkdir "$GITHUB_WORKSPACE/zips"
|
||||
cp "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
|
||||
mv "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
|
||||
cd "$GITHUB_WORKSPACE/zips"
|
||||
unzip -qq woocommerce.zip
|
||||
rm woocommerce.zip
|
||||
mv woocommerce woocommerce-dev
|
||||
zip -q -r "woocommerce-dev.zip" "woocommerce-dev/"
|
||||
zip -q -r -9 "woocommerce-dev.zip" "woocommerce-dev/"
|
||||
rm -fR "$GITHUB_WORKSPACE/zips/woocommerce-dev"
|
||||
|
||||
# Plugin data is passed as a JSON object.
|
||||
|
|
|
@ -66,13 +66,13 @@ jobs:
|
|||
|
||||
mkdir "$GITHUB_WORKSPACE/zips"
|
||||
mkdir -p "$GITHUB_WORKSPACE/unzips/woocommerce"
|
||||
cp "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
|
||||
mv "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
|
||||
cd "$GITHUB_WORKSPACE/zips"
|
||||
unzip -qq woocommerce.zip
|
||||
cp -r woocommerce "$GITHUB_WORKSPACE/unzips/woocommerce/woocommerce"
|
||||
rm woocommerce.zip
|
||||
mv woocommerce woocommerce-dev
|
||||
zip -q -r "woocommerce-dev.zip" "woocommerce-dev/"
|
||||
zip -q -r -9 "woocommerce-dev.zip" "woocommerce-dev/"
|
||||
rm -fR "$GITHUB_WORKSPACE/zips/woocommerce-dev"
|
||||
# Plugin data is passed as a JSON object.
|
||||
PLUGIN_DATA="{}"
|
||||
|
|
|
@ -20,9 +20,11 @@ if [ ! -d "packages/" ]; then
|
|||
output 1 "run \"composer install\" before proceed."
|
||||
fi
|
||||
|
||||
# Autoloader
|
||||
# Autoloader optimization is forced to prevent OOM fatal errors in JetPack Autoloader.
|
||||
# We running the optimization in background to speedup build process, with dev-environments in mind.
|
||||
# Building zips enforcing the optimization during the install process, so we are good around building releases as well.
|
||||
output 3 "Updating autoloader classmaps..."
|
||||
composer dump-autoload
|
||||
composer dump-autoload --optimize --quiet &
|
||||
output 2 "Done"
|
||||
|
||||
if [ -z "$SKIP_UPDATE_TEXTDOMAINS" ]; then
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
Build: speedup dependencies installation by disabling composer optimize autoloading by default.
|
|
@ -40,7 +40,6 @@
|
|||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": {
|
||||
"woocommerce/action-scheduler": "dist"
|
||||
},
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
"command": "test:php:env",
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -129,6 +130,7 @@
|
|||
"command": "test:php:env",
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -154,6 +156,7 @@
|
|||
"command": "test:php:env",
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -179,6 +182,7 @@
|
|||
"command": "test:php:env",
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -205,6 +209,7 @@
|
|||
"optional": true,
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -238,6 +243,7 @@
|
|||
],
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -384,6 +390,7 @@
|
|||
],
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -466,6 +473,7 @@
|
|||
"optional": false,
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -494,6 +502,7 @@
|
|||
"optional": false,
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -524,6 +533,7 @@
|
|||
"optional": true,
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
@ -545,6 +555,7 @@
|
|||
"optional": true,
|
||||
"changes": [
|
||||
"client/admin/config/*.json",
|
||||
"composer.json",
|
||||
"composer.lock",
|
||||
"includes/**/*.php",
|
||||
"patterns/**/*.php",
|
||||
|
|
Loading…
Reference in New Issue