ci: cache the Shopware project, drop duplicate install, reuse the tested zip in release
version-changelog / version-changelog (pull_request) Successful in 24s
plugin-checks / package (pull_request) Successful in 1m18s
plugin-checks / phpunit (pull_request) Failing after 1m33s

- phpunit: cache the prepared project (vendor + phpunit) monthly via cache restore/save;
  drop system:install/plugin:install (TestBootstrapper installs into its own test DB, so
  every migration ran twice, ~5.5 min each); relax InnoDB durability on the CI database
- package: save the tested zip keyed by the commit's tree hash; release restores it and
  only re-packages on a miss, but always validates and asserts the zip
- cancel superseded PR runs (concurrency)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
haylanandClaude Bot committed 2026-10-04 00:29:17 +02:00
1 parent 9f760cb6b0
commit 37aba5d2f0
2 files changed
+71 -26

No files matched your search

+23 -5
View File
@@ -49,8 +49,22 @@ jobs:
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/cache@v4
# Reuse the zip the PR workflow already built and tested for this exact tree.
- name: Tree hash of this commit
if: steps.meta.outputs.skip == 'false'
id: tree
run: echo "hash=$(git rev-parse "${GITHUB_SHA}^{tree}")" >> "$GITHUB_OUTPUT"
- name: Restore the tested zip from the PR run
if: steps.meta.outputs.skip == 'false'
id: prebuilt
uses: actions/cache/restore@v4
with:
path: .build/package.zip
key: plugin-zip-${{ steps.tree.outputs.hash }}
- uses: actions/cache@v4
if: steps.meta.outputs.skip == 'false' && steps.prebuilt.outputs.cache-hit != 'true'
with:
path: |
~/.npm
@@ -58,12 +72,16 @@ jobs:
key: swcli-${{ runner.os }}-${{ hashFiles('composer.json', 'src/Resources/app/**/package*.json') }}
restore-keys: swcli-${{ runner.os }}-
- name: Package extension (prebuilt admin/storefront assets)
if: steps.meta.outputs.skip == 'false'
- name: Package extension (only if the tested zip is not available)
if: steps.meta.outputs.skip == 'false' && steps.prebuilt.outputs.cache-hit != 'true'
run: |
shopware-cli extension package . --output-directory .build \
--filename "${{ steps.meta.outputs.zip }}" --git-commit "$GITHUB_SHA"
shopware-cli extension package . --output-directory .build --filename package.zip --git-commit "$GITHUB_SHA"
- name: Name the zip
if: steps.meta.outputs.skip == 'false'
run: mv .build/package.zip ".build/${{ steps.meta.outputs.zip }}"
# Cheap, and guards against a bad cache entry: always validate what ships.
- name: Validate packaged zip
if: steps.meta.outputs.skip == 'false'
run: shopware-cli extension validate ".build/${{ steps.meta.outputs.zip }}"