mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
feat(cache-magento): add stamp caching for vendor/ directory (#245)
Adds an opt-in `stamp` mode that caches the extracted `vendor/` directory in addition to the Composer download cache. On a warm hit, `composer install` is effectively a no-op and shaves 2–5 minutes off a full Magento install.
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Args: composer_cache_key os php_version composer_version
|
||||
# Args: composer_cache_key os php_version composer_version project lock_hash
|
||||
COMPOSER_CACHE_KEY="$1"
|
||||
OS="$2"
|
||||
PHP_VERSION="$3"
|
||||
COMPOSER_VERSION="$4"
|
||||
PROJECT="$5"
|
||||
LOCK_HASH="${6:-}"
|
||||
|
||||
echo "download-key=composer | v5.8 | ${OS} | ${COMPOSER_CACHE_KEY} | ${COMPOSER_VERSION} | ${PHP_VERSION}"
|
||||
MODE="extension"
|
||||
SUFFIX=""
|
||||
if [ -n "$PROJECT" ]; then
|
||||
MODE="store"
|
||||
[ -n "$LOCK_HASH" ] && SUFFIX=" | $LOCK_HASH"
|
||||
fi
|
||||
|
||||
BASE="composer | v5.8 | ${OS} | ${MODE} | ${COMPOSER_CACHE_KEY} | ${COMPOSER_VERSION} | ${PHP_VERSION}"
|
||||
echo "download-key=${BASE}${SUFFIX}"
|
||||
echo "download-restore-key=${BASE}"
|
||||
echo "stamp-key=composer | stamp | v5.8 | ${OS} | ${MODE} | ${COMPOSER_CACHE_KEY} | ${COMPOSER_VERSION} | ${PHP_VERSION}${SUFFIX}"
|
||||
|
||||
Reference in New Issue
Block a user