mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat(check-store): enable stamp caching (#247)
This commit is contained in:
@@ -43,26 +43,49 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: shivammathur/setup-php@v2
|
- uses: ./setup-magento
|
||||||
|
id: setup-magento
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
tools: composer:v${{ matrix.composer }}
|
tools: composer:v${{ matrix.composer }}
|
||||||
coverage: none
|
magento_version: ${{ matrix.magento }}
|
||||||
|
mode: extension
|
||||||
|
|
||||||
|
- run: composer update --no-install
|
||||||
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
|
||||||
- uses: ./cache-magento
|
- uses: ./cache-magento
|
||||||
with:
|
with:
|
||||||
composer_cache_key: ${{ matrix.magento }}
|
composer_cache_key: ${{ matrix.magento }}
|
||||||
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
stamp: true
|
||||||
|
|
||||||
- name: Create Magento store fixture
|
- name: Inspect stamp cache contents
|
||||||
run: composer create-project --repository-url="https://mirror.mage-os.org/" "${{ matrix.magento }}" ./store-fixture
|
if: always()
|
||||||
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
run: |
|
||||||
|
echo "=== top-level vendor/magento ==="
|
||||||
|
ls vendor/magento/ 2>/dev/null | head -30 || echo "(no vendor/magento)"
|
||||||
|
echo
|
||||||
|
echo "=== magento2-base presence ==="
|
||||||
|
if [ -d vendor/magento/magento2-base ]; then
|
||||||
|
echo "PRESENT — file count: $(find vendor/magento/magento2-base -type f | wc -l)"
|
||||||
|
else
|
||||||
|
echo "ABSENT (negation worked)"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
echo "=== installed.json mentions magento/magento2-base ==="
|
||||||
|
grep -c '"name": "magento/magento2-base"' vendor/composer/installed.json 2>/dev/null || echo 0
|
||||||
|
|
||||||
- name: Strip vendor from fixture
|
- run: composer install
|
||||||
run: rm -rf ./store-fixture/vendor
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: store-fixture-${{ matrix.version }}
|
name: store-fixture-${{ matrix.version }}
|
||||||
path: ./store-fixture
|
path: |
|
||||||
|
${{ steps.setup-magento.outputs.path }}
|
||||||
|
!${{ steps.setup-magento.outputs.path }}/vendor
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|
||||||
check-store:
|
check-store:
|
||||||
@@ -73,5 +96,6 @@ jobs:
|
|||||||
uses: ./.github/workflows/check-store.yaml
|
uses: ./.github/workflows/check-store.yaml
|
||||||
with:
|
with:
|
||||||
store_artifact_name: store-fixture-${{ matrix.version }}
|
store_artifact_name: store-fixture-${{ matrix.version }}
|
||||||
path: "."
|
path: "_ghamagento/"
|
||||||
composer_cache_key: ${{ matrix.magento }}
|
composer_cache_key: ${{ matrix.magento }}
|
||||||
|
stamp: true
|
||||||
@@ -20,6 +20,12 @@ on:
|
|||||||
default: ""
|
default: ""
|
||||||
description: "If provided, download store files from this artifact instead of using actions/checkout."
|
description: "If provided, download store files from this artifact instead of using actions/checkout."
|
||||||
|
|
||||||
|
stamp:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: "Cache the vendor/ directory in addition to the Composer download cache."
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
composer_auth:
|
composer_auth:
|
||||||
required: false
|
required: false
|
||||||
@@ -79,6 +85,8 @@ jobs:
|
|||||||
- uses: graycoreio/github-actions-magento2/cache-magento@main
|
- uses: graycoreio/github-actions-magento2/cache-magento@main
|
||||||
with:
|
with:
|
||||||
composer_cache_key: ${{ inputs.composer_cache_key }}
|
composer_cache_key: ${{ inputs.composer_cache_key }}
|
||||||
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
stamp: ${{ inputs.stamp }}
|
||||||
|
|
||||||
- name: Composer install
|
- name: Composer install
|
||||||
working-directory: ${{ steps.setup-magento.outputs.path }}
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
@@ -138,6 +146,8 @@ jobs:
|
|||||||
- uses: graycoreio/github-actions-magento2/cache-magento@main
|
- uses: graycoreio/github-actions-magento2/cache-magento@main
|
||||||
with:
|
with:
|
||||||
composer_cache_key: ${{ inputs.composer_cache_key }}
|
composer_cache_key: ${{ inputs.composer_cache_key }}
|
||||||
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
stamp: ${{ inputs.stamp }}
|
||||||
|
|
||||||
- name: Composer install
|
- name: Composer install
|
||||||
working-directory: ${{ steps.setup-magento.outputs.path }}
|
working-directory: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
|||||||
Reference in New Issue
Block a user