From 2e0c168af6602d830969136e639eed181dbb379a Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 09:21:03 +0200 Subject: [PATCH 01/21] refactor: ci --- .claude/settings.local.json | 8 ++ .github/actions/acceptance/action.yml | 82 ++++++++++++++++ .github/actions/jest/action.yml | 31 ++++++ .github/actions/phpstan/action.yml | 48 ++++++++++ .github/actions/phpunit/action.yml | 36 +++++++ .github/workflows/acceptance.yaml | 95 ------------------- .github/workflows/acceptance.yml | 42 ++++++++ .github/workflows/admin.yaml | 84 ---------------- .github/workflows/admin.yml | 80 ++++++++++++++++ .github/workflows/check-pr-title.yml | 52 +++++----- .github/workflows/integration.yaml | 81 ---------------- .github/workflows/integration.yml | 72 ++++++++++++++ .github/workflows/nightly.yml | 74 +++++++++++++++ .github/workflows/php.yaml | 62 ------------ .github/workflows/php.yml | 37 ++++++++ .github/workflows/store-release.yml | 18 ++-- composer.json | 2 +- src/Resources/app/administration/package.json | 74 +++++++-------- 18 files changed, 583 insertions(+), 395 deletions(-) create mode 100644 .claude/settings.local.json create mode 100644 .github/actions/acceptance/action.yml create mode 100644 .github/actions/jest/action.yml create mode 100644 .github/actions/phpstan/action.yml create mode 100644 .github/actions/phpunit/action.yml delete mode 100644 .github/workflows/acceptance.yaml create mode 100644 .github/workflows/acceptance.yml delete mode 100644 .github/workflows/admin.yaml create mode 100644 .github/workflows/admin.yml delete mode 100644 .github/workflows/integration.yaml create mode 100644 .github/workflows/integration.yml create mode 100644 .github/workflows/nightly.yml delete mode 100644 .github/workflows/php.yaml create mode 100644 .github/workflows/php.yml diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 000000000..f0875371b --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,8 @@ +{ + "permissions": { + "allow": [ + "Read(//Users/l.kemper/code/swag/shopware/**)", + "Bash(vendor/bin/phpunit custom/plugins/SwagMigrationAssistant/tests/unit/Migration/History/LogGroupingServiceTest.php)" + ] + } +} diff --git a/.github/actions/acceptance/action.yml b/.github/actions/acceptance/action.yml new file mode 100644 index 000000000..b6a581b92 --- /dev/null +++ b/.github/actions/acceptance/action.yml @@ -0,0 +1,82 @@ +name: Acceptance +description: Set up the extension and run acceptance tests + +inputs: + extension_name: + required: true + description: Extension directory name + platform_branch: + required: true + description: Shopware version to install + update_snapshots: + required: false + default: 'false' + description: Whether snapshots should be updated + +runs: + using: composite + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ inputs.extension_name }} + shopwareVersion: ${{ inputs.platform_branch }} + install: true + install-admin: true + install-storefront: false + mysqlVersion: skip + env: prod + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + + - name: Setup Migration Assistant + shell: bash + run: | + composer run build:js:admin + cd custom/plugins/${{ inputs.extension_name }}/tests + mysql -uroot < _fixtures/database/shopware55corrupted.sql + + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ hashFiles('custom/plugins/**/tests/acceptance/package-lock.json') }} + + - name: Install playwright + working-directory: custom/plugins/${{ inputs.extension_name }}/tests/acceptance + shell: bash + run: | + npm ci + npx playwright install --with-deps + + - name: Run Playwright + working-directory: custom/plugins/${{ inputs.extension_name }}/tests/acceptance + shell: bash + env: + DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware55 + UPDATE_SNAPSHOTS: ${{ inputs.update_snapshots }} + run: npm run test + + - name: Upload test artifacts + uses: actions/upload-artifact@v4 + if: always() + with: + name: e2e-${{ inputs.extension_name }}-${{ github.sha }}-${{ inputs.platform_branch }} + path: | + custom/plugins/${{ inputs.extension_name }}/tests/acceptance/test-results/ + custom/plugins/${{ inputs.extension_name }}/tests/acceptance/playwright-report/ + retention-days: 3 + + - name: Upload updated snapshots + if: inputs.update_snapshots == 'true' + uses: actions/upload-artifact@v4 + with: + name: visual-snapshots-${{ inputs.platform_branch }} + path: custom/plugins/${{ inputs.extension_name }}/tests/acceptance/snapshots/ + retention-days: 3 diff --git a/.github/actions/jest/action.yml b/.github/actions/jest/action.yml new file mode 100644 index 000000000..375e6b776 --- /dev/null +++ b/.github/actions/jest/action.yml @@ -0,0 +1,31 @@ +name: Jest +description: Set up the extension and run Jest + +inputs: + extension_name: + required: true + description: Extension directory name + +runs: + using: composite + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ inputs.extension_name }} + install: true + install-admin: true + install-storefront: false + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + - name: Run Jest + shell: bash + run: | + composer -d custom/plugins/${{ inputs.extension_name }} run admin:install + composer -d custom/plugins/${{ inputs.extension_name }} run admin:unit -- --ci diff --git a/.github/actions/phpstan/action.yml b/.github/actions/phpstan/action.yml new file mode 100644 index 000000000..05a3c63ba --- /dev/null +++ b/.github/actions/phpstan/action.yml @@ -0,0 +1,48 @@ +name: PHPStan +description: Set up the extension and run PHPStan + +inputs: + extension_name: + required: true + description: Extension directory name + +runs: + using: composite + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + env: + DATABASE_URL: mysql://root@127.0.0.1/shopware + with: + extensionName: ${{ inputs.extension_name }} + install: true + install-admin: true + install-storefront: true + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + - name: Create phpstan.neon + working-directory: custom/plugins/${{ inputs.extension_name }} + shell: bash + run: | + printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon + - name: PHPStan cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/var/phpstan + key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ github.repository }}-phpstan- + - name: Build PHPStan Bootstrap + shell: bash + run: php ${GITHUB_WORKSPACE}/src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php + - name: Run PHPStan + shell: bash + run: | + composer -d custom/plugins/${{ inputs.extension_name }} dump-autoload --dev + composer -d custom/plugins/${{ inputs.extension_name }} run phpstan diff --git a/.github/actions/phpunit/action.yml b/.github/actions/phpunit/action.yml new file mode 100644 index 000000000..566543460 --- /dev/null +++ b/.github/actions/phpunit/action.yml @@ -0,0 +1,36 @@ +name: PHPUnit +description: Set up the extension and run PHPUnit + +inputs: + extension_name: + required: true + description: Extension directory name + platform_branch: + required: true + description: Shopware version to install + +runs: + using: composite + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ inputs.extension_name }} + install: true + shopwareVersion: ${{ inputs.platform_branch }} + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + - name: Import SW5 TestData DB + working-directory: custom/plugins/${{ inputs.extension_name }}/tests + shell: bash + run: mysql -uroot < _fixtures/database/shopware55.sql + - name: Run PHPUnit + working-directory: custom/plugins/${{ inputs.extension_name }} + shell: bash + run: php -d pcov.enabled=1 -d pcov.directory=${PWD} -d pcov.exclude='~(vendor|tests|node_modules)~' ${GITHUB_WORKSPACE}/vendor/bin/phpunit --configuration phpunit.xml.dist diff --git a/.github/workflows/acceptance.yaml b/.github/workflows/acceptance.yaml deleted file mode 100644 index 9fbfadb7e..000000000 --- a/.github/workflows/acceptance.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: Acceptance - -on: - schedule: - - cron: '0 3 * * *' # nightly at 3 am utc - workflow_dispatch: - inputs: - update_snapshots: - description: 'Update snapshots' - required: false - type: boolean - default: false - push: - branches: - - trunk - pull_request: - -jobs: - playwright: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - PLATFORM_BRANCH: ["trunk"] - services: - mysql: - image: mysql:8.0 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: shopware - ports: - - 3306:3306 - env: - DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware - - steps: - - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ github.event.repository.name }} - shopwareVersion: ${{ matrix.PLATFORM_BRANCH }} - install: true - install-admin: true - install-storefront: false - mysqlVersion: skip - env: prod - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - - name: Setup Migration Assistant - run: | - composer run build:js:admin - cd custom/plugins/${{ github.event.repository.name }}/tests - mysql -uroot < _fixtures/database/shopware55corrupted.sql - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ hashFiles('custom/plugins/**/tests/acceptance/package-lock.json') }} - - - name: Install playwright - working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance - run: | - npm ci - npx playwright install --with-deps - - - name: Run Playwright - working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance - env: - DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware55 - UPDATE_SNAPSHOTS: ${{ github.event.inputs.update_snapshots }} - run: npm run test - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: e2e-${{ github.event.repository.name }}-${{ github.sha }}-${{ matrix.PLATFORM_BRANCH }} - path: | - custom/plugins/${{ github.event.repository.name }}/tests/acceptance/test-results/ - custom/plugins/${{ github.event.repository.name }}/tests/acceptance/playwright-report/ - retention-days: 3 - - - name: Upload updated snapshots - if: github.event.inputs.update_snapshots == 'true' - uses: actions/upload-artifact@v4 - with: - name: visual-snapshots-${{ matrix.PLATFORM_BRANCH }} - path: custom/plugins/${{ github.event.repository.name }}/tests/acceptance/snapshots/ - retention-days: 3 diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml new file mode 100644 index 000000000..ee0a78489 --- /dev/null +++ b/.github/workflows/acceptance.yml @@ -0,0 +1,42 @@ +name: Acceptance + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + PLATFORM_BRANCH: trunk + +on: + workflow_dispatch: + inputs: + update_snapshots: + description: Update snapshots + required: false + type: boolean + default: false + push: + branches: + - trunk + pull_request: + +jobs: + playwright: + name: Playwright + runs-on: ubuntu-latest + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: shopware + ports: + - 3306:3306 + env: + DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run Playwright + uses: ./.github/actions/acceptance + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + update_snapshots: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.update_snapshots == 'true' }} diff --git a/.github/workflows/admin.yaml b/.github/workflows/admin.yaml deleted file mode 100644 index 00fe4e2a8..000000000 --- a/.github/workflows/admin.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Admin - -on: - workflow_dispatch: - push: - branches: - - trunk - pull_request: - paths: - - src/Resources/app/administration/** - - tests/Jest/** - - .github/workflows/admin.yml - workflow_call: - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ github.event.repository.name }} - install: true - install-admin: true - install-storefront: false - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - run: | - composer -d custom/plugins/${{ github.event.repository.name }} run admin:install - composer -d custom/plugins/${{ github.event.repository.name }} run lint:admin - composer -d custom/plugins/${{ github.event.repository.name }} run format:admin - composer -d custom/plugins/${{ github.event.repository.name }} run format:md - - stylelint: - name: Stylelint - runs-on: ubuntu-latest - steps: - - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ github.event.repository.name }} - install: true - install-admin: true - install-storefront: false - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - run: | - composer -d custom/plugins/${{ github.event.repository.name }} run admin:install - composer -d custom/plugins/${{ github.event.repository.name }} run lint:admin:scss - - jest: - name: Jest - runs-on: ubuntu-latest - env: - ARTIFACTS_PATH: ${{ github.workspace }}/development - steps: - - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ github.event.repository.name }} - install: true - install-admin: true - install-storefront: false - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - run: | - composer -d custom/plugins/${{ github.event.repository.name }} run admin:install - composer -d custom/plugins/${{ github.event.repository.name }} run admin:unit -- --ci diff --git a/.github/workflows/admin.yml b/.github/workflows/admin.yml new file mode 100644 index 000000000..940ff126c --- /dev/null +++ b/.github/workflows/admin.yml @@ -0,0 +1,80 @@ +name: Admin + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + +on: + workflow_dispatch: + push: + branches: + - trunk + pull_request: + paths: + - src/Resources/app/administration/** + - tests/Jest/** + - .github/actions/** + - .github/workflows/*.yml + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ env.EXTENSION_NAME }} + install: true + install-admin: true + install-storefront: false + extraRepositories: | + { + "${{ env.EXTENSION_NAME }}": { + "type": "path", + "url": "custom/plugins/${{ env.EXTENSION_NAME }}", + "symlink": true + } + } + - name: Run lint and formatting checks + run: | + composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install + composer -d custom/plugins/${{ env.EXTENSION_NAME }} run lint:admin + composer -d custom/plugins/${{ env.EXTENSION_NAME }} run format:admin + composer -d custom/plugins/${{ env.EXTENSION_NAME }} run format:md + + stylelint: + name: Stylelint + runs-on: ubuntu-latest + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ env.EXTENSION_NAME }} + install: true + install-admin: true + install-storefront: false + extraRepositories: | + { + "${{ env.EXTENSION_NAME }}": { + "type": "path", + "url": "custom/plugins/${{ env.EXTENSION_NAME }}", + "symlink": true + } + } + - name: Run stylelint + run: | + composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install + composer -d custom/plugins/${{ env.EXTENSION_NAME }} run lint:admin:scss + + jest: + name: Jest + runs-on: ubuntu-latest + env: + ARTIFACTS_PATH: ${{ github.workspace }}/development + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run Jest + uses: ./.github/actions/jest + with: + extension_name: ${{ env.EXTENSION_NAME }} diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index 6da327569..b1fe77722 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -1,33 +1,33 @@ name: Check PR title on: - pull_request: - types: - - opened - - reopened - - edited - - synchronize + pull_request: + types: + - opened + - reopened + - edited + - synchronize permissions: - pull-requests: read + pull-requests: read jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # 6.1.1 - with: - types: | - feat - fix - chore - docs - style - refactor - perf - test - build - ci - revert - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + lint: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # 6.1.1 + with: + types: | + feat + fix + chore + docs + style + refactor + perf + test + build + ci + revert + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml deleted file mode 100644 index d7e366ea5..000000000 --- a/.github/workflows/integration.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: Integration - -on: - workflow_dispatch: - push: - branches: - - trunk - pull_request: - -jobs: - danger: - name: Danger Check - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Run Danger PHP - uses: docker://ghcr.io/shyim/danger-php:latest - with: - args: ci - env: - GITHUB_REPOSITORY: ${{ github.repository }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} - - build_zip: - name: Build and validate zip - runs-on: ubuntu-latest - steps: - - name: Build - uses: shopware/github-actions/build-zip@main - with: - extensionName: ${{ github.event.repository.name }} - - phpunit: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - PLATFORM_BRANCH: ["trunk"] # TODO add min version 6.7.0 here when trunk becomes > 6.7.0 - steps: - - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ github.event.repository.name }} - install: true - shopwareVersion: ${{ matrix.PLATFORM_BRANCH }} - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - name: Import SW5 TestData DB - working-directory: custom/plugins/${{ github.event.repository.name }}/tests - run: mysql -uroot < _fixtures/database/shopware55.sql - - name: Run PHPUnit - working-directory: custom/plugins/${{ github.event.repository.name }} - run: php -d pcov.enabled=1 -d pcov.directory=${PWD} -d pcov.exclude='~(vendor|tests|node_modules)~' ${GITHUB_WORKSPACE}/vendor/bin/phpunit --configuration phpunit.xml.dist - - smoke_test: - runs-on: ubuntu-latest - steps: - - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ github.event.repository.name }} - install: true - install-admin: true - install-storefront: true - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - name: Uninstall Plugin - run: php bin/console plugin:uninstall ${{ github.event.repository.name }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 000000000..1c911ab5b --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,72 @@ +name: Integration + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + PLATFORM_BRANCH: trunk + +on: + workflow_dispatch: + push: + branches: + - trunk + pull_request: + +jobs: + danger: + name: Danger Check + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run Danger PHP + uses: docker://ghcr.io/shyim/danger-php:latest + with: + args: ci + env: + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} + + build_zip: + name: Build and validate zip + runs-on: ubuntu-latest + steps: + - name: Build + uses: shopware/github-actions/build-zip@main + with: + extensionName: ${{ env.EXTENSION_NAME }} + + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run PHPUnit + uses: ./.github/actions/phpunit + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + + smoke_test: + name: Smoke test + runs-on: ubuntu-latest + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ env.EXTENSION_NAME }} + install: true + install-admin: true + install-storefront: true + extraRepositories: | + { + "${{ env.EXTENSION_NAME }}": { + "type": "path", + "url": "custom/plugins/${{ env.EXTENSION_NAME }}", + "symlink": true + } + } + - name: Uninstall Plugin + run: php bin/console plugin:uninstall ${{ env.EXTENSION_NAME }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..d614420f4 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,74 @@ +name: Nightly + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + PLATFORM_BRANCH: trunk + +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: + +concurrency: + group: nightly-${{ github.ref }} + cancel-in-progress: false + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run PHPStan + uses: ./.github/actions/phpstan + with: + extension_name: ${{ env.EXTENSION_NAME }} + + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run PHPUnit + uses: ./.github/actions/phpunit + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + + jest: + name: Jest + runs-on: ubuntu-latest + env: + ARTIFACTS_PATH: ${{ github.workspace }}/development + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run Jest + uses: ./.github/actions/jest + with: + extension_name: ${{ env.EXTENSION_NAME }} + + acceptance: + name: Playwright + runs-on: ubuntu-latest + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: shopware + ports: + - 3306:3306 + env: + DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run Playwright + uses: ./.github/actions/acceptance + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + update_snapshots: false diff --git a/.github/workflows/php.yaml b/.github/workflows/php.yaml deleted file mode 100644 index 0d6b20ca2..000000000 --- a/.github/workflows/php.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: PHP Checks - -on: - workflow_dispatch: - push: - branches: - - trunk - pull_request: - paths: - - composer.json - - src/**/*.php - - tests/**/*.php - - .github/workflows/php.yml - -jobs: - codestyle_php: - name: Codestyle PHP - runs-on: ubuntu-latest - steps: - - uses: shopware/github-actions/cs-fixer@main - with: - rules: "" - - phpstan: - runs-on: ubuntu-latest - steps: - - uses: shopware/github-actions/setup-extension@main - env: - DATABASE_URL: mysql://root@127.0.0.1/shopware - with: - extensionName: ${{ github.event.repository.name }} - install: true - install-admin: true - install-storefront: true - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - } - } - - name: Create phpstan.neon - working-directory: custom/plugins/${{ github.event.repository.name }} - shell: bash - run: | - printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon - - name: PHPStan cache - uses: actions/cache@v4 - with: - path: ${{ github.workspace }}/var/phpstan - key: ${{ runner.OS }}-${{ github.repository }}-phpstan-${{ github.sha }} - restore-keys: | - ${{ runner.OS }}-${{ github.repository }}-phpstan- - - name: Build PHPStan Bootstrap - shell: bash - run: php ${GITHUB_WORKSPACE}/src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php - - name: Run PHPStan - shell: bash - run: | - composer -d custom/plugins/${{ github.event.repository.name }} dump-autoload --dev - composer -d custom/plugins/${{ github.event.repository.name }} run phpstan diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 000000000..e8add54f1 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,37 @@ +name: PHP Checks + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + +on: + workflow_dispatch: + push: + branches: + - trunk + pull_request: + paths: + - composer.json + - src/**/*.php + - tests/**/*.php + - .github/actions/** + - .github/workflows/*.yml + +jobs: + codestyle_php: + name: Codestyle PHP + runs-on: ubuntu-latest + steps: + - uses: shopware/github-actions/cs-fixer@main + with: + rules: '' + + phpstan: + name: PHPStan + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Run PHPStan + uses: ./.github/actions/phpstan + with: + extension_name: ${{ env.EXTENSION_NAME }} diff --git a/.github/workflows/store-release.yml b/.github/workflows/store-release.yml index e93b261a4..3d532dd38 100644 --- a/.github/workflows/store-release.yml +++ b/.github/workflows/store-release.yml @@ -1,12 +1,12 @@ name: Release to Store on: - workflow_dispatch: + workflow_dispatch: jobs: - build: - uses: shopware/github-actions/.github/workflows/store-release.yml@main - with: - extensionName: ${{ github.event.repository.name }} - secrets: - clientId: ${{ secrets.SHOPWARE_CLI_ACCOUNT_CLIENT_ID }} - clientSecret: ${{ secrets.SHOPWARE_CLI_ACCOUNT_CLIENT_SECRET }} - ghToken: ${{ secrets.GITHUB_TOKEN }} + build: + uses: shopware/github-actions/.github/workflows/store-release.yml@main + with: + extensionName: ${{ github.event.repository.name }} + secrets: + clientId: ${{ secrets.SHOPWARE_CLI_ACCOUNT_CLIENT_ID }} + clientSecret: ${{ secrets.SHOPWARE_CLI_ACCOUNT_CLIENT_SECRET }} + ghToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/composer.json b/composer.json index 0ae6668b5..7e8f63ea3 100644 --- a/composer.json +++ b/composer.json @@ -85,8 +85,8 @@ "@npm:admin run format:fix", "@npm:acceptance run format:fix" ], - "format:md": "@npm:admin run format:md", "format:md:fix": "@npm:admin run format:md:fix", + "format:yml:fix": "@npm:admin run format:yml:fix", "admin:unit": "@npm:jest run unit", "admin:unit:watch": "@npm:jest run unit-watch", "admin:acceptance": "@npm:acceptance run test", diff --git a/src/Resources/app/administration/package.json b/src/Resources/app/administration/package.json index 5b82b4b2d..1b1a11aaf 100644 --- a/src/Resources/app/administration/package.json +++ b/src/Resources/app/administration/package.json @@ -1,39 +1,39 @@ { - "name": "swag-migration-assistant", - "description": "Plugin for migrating data to Shopware 6", - "author": "shopware AG", - "license": "MIT", - "scripts": { - "lint": "eslint --ext .js,.ts,.vue,.html,.html.twig .", - "lint:fix": "npm run lint -- --fix", - "lint:scss": "stylelint ./**/*.scss", - "lint:scss:fix": "npm run lint:scss -- --fix", - "format": "prettier --check \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", - "format:fix": "prettier --write \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", - "format:md": "prettier --check \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", - "format:md:fix": "prettier --write \"../../../../*.md\" --config ../../../../.prettierrc.json --cache" - }, - "devDependencies": { - "@shopware-ag/eslint-config-base": "2.0.0", - "@typescript-eslint/eslint-plugin": "8.21.0", - "@typescript-eslint/parser": "8.21.0", - "eslint": "8.57.1", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-file-progress": "1.5.0", - "eslint-plugin-filename-rules": "1.3.1", - "eslint-plugin-html": "7.1.0", - "eslint-plugin-import": "2.31.0", - "eslint-plugin-inclusive-language": "2.2.1", - "eslint-plugin-vue": "9.32.0", - "eslint-plugin-vuejs-accessibility": "2.4.1", - "prettier": "3.6.2", - "prettier-plugin-multiline-arrays": "3.0.6", - "stylelint": "14.16.1", - "stylelint-config-standard": "26.0.0", - "stylelint-config-standard-scss": "5.0.0", - "stylelint-junit-formatter": "0.2.2", - "typescript": "5.7.3", - "vue": "3.5.22", - "vue-eslint-parser": "9.4.3" - } + "name": "swag-migration-assistant", + "description": "Plugin for migrating data to Shopware 6", + "author": "shopware AG", + "license": "MIT", + "scripts": { + "lint": "eslint --ext .js,.ts,.vue,.html,.html.twig .", + "lint:fix": "npm run lint -- --fix", + "lint:scss": "stylelint ./**/*.scss", + "lint:scss:fix": "npm run lint:scss -- --fix", + "format": "prettier --check \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", + "format:fix": "prettier --write \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", + "format:md:fix": "prettier --write \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", + "format:yml:fix": "prettier --write \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache" + }, + "devDependencies": { + "@shopware-ag/eslint-config-base": "2.0.0", + "@typescript-eslint/eslint-plugin": "8.21.0", + "@typescript-eslint/parser": "8.21.0", + "eslint": "8.57.1", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-file-progress": "1.5.0", + "eslint-plugin-filename-rules": "1.3.1", + "eslint-plugin-html": "7.1.0", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-inclusive-language": "2.2.1", + "eslint-plugin-vue": "9.32.0", + "eslint-plugin-vuejs-accessibility": "2.4.1", + "prettier": "3.6.2", + "prettier-plugin-multiline-arrays": "3.0.6", + "stylelint": "14.16.1", + "stylelint-config-standard": "26.0.0", + "stylelint-config-standard-scss": "5.0.0", + "stylelint-junit-formatter": "0.2.2", + "typescript": "5.7.3", + "vue": "3.5.22", + "vue-eslint-parser": "9.4.3" + } } From fa58331fa78fc2080da3dab17afcdbc6bd394072 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 09:37:24 +0200 Subject: [PATCH 02/21] ci: add npm caching & concurrency --- .claude/settings.local.json | 8 -------- .github/actions/acceptance/action.yml | 6 ++++++ .github/actions/jest/action.yml | 7 +++++++ .github/actions/phpstan/action.yml | 4 ++++ .github/actions/phpunit/action.yml | 2 ++ .github/workflows/acceptance.yml | 5 +++++ .github/workflows/admin.yml | 9 ++++++++- .github/workflows/integration.yml | 7 +++++++ .github/workflows/nightly.yml | 6 +++++- .github/workflows/php.yml | 7 ++++++- 10 files changed, 50 insertions(+), 11 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index f0875371b..000000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "permissions": { - "allow": [ - "Read(//Users/l.kemper/code/swag/shopware/**)", - "Bash(vendor/bin/phpunit custom/plugins/SwagMigrationAssistant/tests/unit/Migration/History/LogGroupingServiceTest.php)" - ] - } -} diff --git a/.github/actions/acceptance/action.yml b/.github/actions/acceptance/action.yml index b6a581b92..b31059182 100644 --- a/.github/actions/acceptance/action.yml +++ b/.github/actions/acceptance/action.yml @@ -16,6 +16,12 @@ inputs: runs: using: composite steps: + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-acceptance-${{ hashFiles('tests/acceptance/package-lock.json') }} + - name: Setup extension uses: shopware/github-actions/setup-extension@main with: diff --git a/.github/actions/jest/action.yml b/.github/actions/jest/action.yml index 375e6b776..6c752741f 100644 --- a/.github/actions/jest/action.yml +++ b/.github/actions/jest/action.yml @@ -9,6 +9,12 @@ inputs: runs: using: composite steps: + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-admin-${{ hashFiles('src/Resources/app/administration/package-lock.json', 'tests/Jest/package-lock.json', 'tests/acceptance/package-lock.json') }} + - name: Setup extension uses: shopware/github-actions/setup-extension@main with: @@ -24,6 +30,7 @@ runs: "symlink": true } } + - name: Run Jest shell: bash run: | diff --git a/.github/actions/phpstan/action.yml b/.github/actions/phpstan/action.yml index 05a3c63ba..63a315a47 100644 --- a/.github/actions/phpstan/action.yml +++ b/.github/actions/phpstan/action.yml @@ -26,11 +26,13 @@ runs: "symlink": true } } + - name: Create phpstan.neon working-directory: custom/plugins/${{ inputs.extension_name }} shell: bash run: | printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon + - name: PHPStan cache uses: actions/cache@v4 with: @@ -38,9 +40,11 @@ runs: key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }} restore-keys: | ${{ runner.os }}-${{ github.repository }}-phpstan- + - name: Build PHPStan Bootstrap shell: bash run: php ${GITHUB_WORKSPACE}/src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php + - name: Run PHPStan shell: bash run: | diff --git a/.github/actions/phpunit/action.yml b/.github/actions/phpunit/action.yml index 566543460..2d6f17079 100644 --- a/.github/actions/phpunit/action.yml +++ b/.github/actions/phpunit/action.yml @@ -26,10 +26,12 @@ runs: "symlink": true } } + - name: Import SW5 TestData DB working-directory: custom/plugins/${{ inputs.extension_name }}/tests shell: bash run: mysql -uroot < _fixtures/database/shopware55.sql + - name: Run PHPUnit working-directory: custom/plugins/${{ inputs.extension_name }} shell: bash diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index ee0a78489..1b2386f8c 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -17,6 +17,10 @@ on: - trunk pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: playwright: name: Playwright @@ -34,6 +38,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run Playwright uses: ./.github/actions/acceptance with: diff --git a/.github/workflows/admin.yml b/.github/workflows/admin.yml index 940ff126c..52cb7bcb4 100644 --- a/.github/workflows/admin.yml +++ b/.github/workflows/admin.yml @@ -13,7 +13,11 @@ on: - src/Resources/app/administration/** - tests/Jest/** - .github/actions/** - - .github/workflows/*.yml + - .github/workflows/** + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: lint: @@ -35,6 +39,7 @@ jobs: "symlink": true } } + - name: Run lint and formatting checks run: | composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install @@ -61,6 +66,7 @@ jobs: "symlink": true } } + - name: Run stylelint run: | composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install @@ -74,6 +80,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run Jest uses: ./.github/actions/jest with: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1c911ab5b..a74fd2551 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -11,6 +11,10 @@ on: - trunk pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: danger: name: Danger Check @@ -19,6 +23,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Run Danger PHP uses: docker://ghcr.io/shyim/danger-php:latest with: @@ -43,6 +48,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run PHPUnit uses: ./.github/actions/phpunit with: @@ -68,5 +74,6 @@ jobs: "symlink": true } } + - name: Uninstall Plugin run: php bin/console plugin:uninstall ${{ env.EXTENSION_NAME }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d614420f4..faa288c3d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,7 +6,7 @@ env: on: schedule: - - cron: '0 3 * * *' + - cron: '0 1 * * *' workflow_dispatch: concurrency: @@ -20,6 +20,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run PHPStan uses: ./.github/actions/phpstan with: @@ -31,6 +32,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run PHPUnit uses: ./.github/actions/phpunit with: @@ -45,6 +47,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run Jest uses: ./.github/actions/jest with: @@ -66,6 +69,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run Playwright uses: ./.github/actions/acceptance with: diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e8add54f1..6f86bd378 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,11 @@ on: - src/**/*.php - tests/**/*.php - .github/actions/** - - .github/workflows/*.yml + - .github/workflows/** + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: codestyle_php: @@ -31,6 +35,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Run PHPStan uses: ./.github/actions/phpstan with: From 5826fe2e7f186bbacefe97a7a3ec940c51ae5506 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 10:05:25 +0200 Subject: [PATCH 03/21] fix: regression --- composer.json | 2 ++ src/Resources/app/administration/package.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 7e8f63ea3..572def163 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,9 @@ "@npm:admin run format:fix", "@npm:acceptance run format:fix" ], + "format:md": "@npm:admin run format:md", "format:md:fix": "@npm:admin run format:md:fix", + "format:yml": "@npm:admin run format:yml", "format:yml:fix": "@npm:admin run format:yml:fix", "admin:unit": "@npm:jest run unit", "admin:unit:watch": "@npm:jest run unit-watch", diff --git a/src/Resources/app/administration/package.json b/src/Resources/app/administration/package.json index 1b1a11aaf..4ce0557d8 100644 --- a/src/Resources/app/administration/package.json +++ b/src/Resources/app/administration/package.json @@ -10,7 +10,9 @@ "lint:scss:fix": "npm run lint:scss -- --fix", "format": "prettier --check \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", "format:fix": "prettier --write \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", + "format:md": "prettier --check \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", "format:md:fix": "prettier --write \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", + "format:yml": "prettier --check \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache", "format:yml:fix": "prettier --write \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache" }, "devDependencies": { From 6c0293d6d34f195a4dc4f31d8424d609926fce2f Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 10:30:40 +0200 Subject: [PATCH 04/21] refactor: no actions --- .github/actions/acceptance/action.yml | 88 ----------------- .github/actions/jest/action.yml | 38 ------- .github/actions/phpstan/action.yml | 52 ---------- .github/actions/phpunit/action.yml | 38 ------- .github/workflows/acceptance.yml | 47 --------- .github/workflows/action-acceptance.yml | 98 +++++++++++++++++++ .github/workflows/action-jest.yml | 42 ++++++++ .github/workflows/action-phpstan.yml | 52 ++++++++++ .github/workflows/action-phpunit.yml | 40 ++++++++ .github/workflows/ci-acceptance.yml | 31 ++++++ .github/workflows/{admin.yml => ci-admin.yml} | 15 +-- ...eck-pr-title.yml => ci-check-pr-title.yml} | 0 .../{integration.yml => ci-integration.yml} | 14 +-- .github/workflows/ci-nightly.yml | 42 ++++++++ .github/workflows/{php.yml => ci-php.yml} | 13 +-- .github/workflows/nightly.yml | 78 --------------- 16 files changed, 315 insertions(+), 373 deletions(-) delete mode 100644 .github/actions/acceptance/action.yml delete mode 100644 .github/actions/jest/action.yml delete mode 100644 .github/actions/phpstan/action.yml delete mode 100644 .github/actions/phpunit/action.yml delete mode 100644 .github/workflows/acceptance.yml create mode 100644 .github/workflows/action-acceptance.yml create mode 100644 .github/workflows/action-jest.yml create mode 100644 .github/workflows/action-phpstan.yml create mode 100644 .github/workflows/action-phpunit.yml create mode 100644 .github/workflows/ci-acceptance.yml rename .github/workflows/{admin.yml => ci-admin.yml} (86%) rename .github/workflows/{check-pr-title.yml => ci-check-pr-title.yml} (100%) rename .github/workflows/{integration.yml => ci-integration.yml} (85%) create mode 100644 .github/workflows/ci-nightly.yml rename .github/workflows/{php.yml => ci-php.yml} (68%) delete mode 100644 .github/workflows/nightly.yml diff --git a/.github/actions/acceptance/action.yml b/.github/actions/acceptance/action.yml deleted file mode 100644 index b31059182..000000000 --- a/.github/actions/acceptance/action.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Acceptance -description: Set up the extension and run acceptance tests - -inputs: - extension_name: - required: true - description: Extension directory name - platform_branch: - required: true - description: Shopware version to install - update_snapshots: - required: false - default: 'false' - description: Whether snapshots should be updated - -runs: - using: composite - steps: - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-acceptance-${{ hashFiles('tests/acceptance/package-lock.json') }} - - - name: Setup extension - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ inputs.extension_name }} - shopwareVersion: ${{ inputs.platform_branch }} - install: true - install-admin: true - install-storefront: false - mysqlVersion: skip - env: prod - extraRepositories: | - { - "${{ inputs.extension_name }}": { - "type": "path", - "url": "custom/plugins/${{ inputs.extension_name }}", - "symlink": true - } - } - - - name: Setup Migration Assistant - shell: bash - run: | - composer run build:js:admin - cd custom/plugins/${{ inputs.extension_name }}/tests - mysql -uroot < _fixtures/database/shopware55corrupted.sql - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ hashFiles('custom/plugins/**/tests/acceptance/package-lock.json') }} - - - name: Install playwright - working-directory: custom/plugins/${{ inputs.extension_name }}/tests/acceptance - shell: bash - run: | - npm ci - npx playwright install --with-deps - - - name: Run Playwright - working-directory: custom/plugins/${{ inputs.extension_name }}/tests/acceptance - shell: bash - env: - DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware55 - UPDATE_SNAPSHOTS: ${{ inputs.update_snapshots }} - run: npm run test - - - name: Upload test artifacts - uses: actions/upload-artifact@v4 - if: always() - with: - name: e2e-${{ inputs.extension_name }}-${{ github.sha }}-${{ inputs.platform_branch }} - path: | - custom/plugins/${{ inputs.extension_name }}/tests/acceptance/test-results/ - custom/plugins/${{ inputs.extension_name }}/tests/acceptance/playwright-report/ - retention-days: 3 - - - name: Upload updated snapshots - if: inputs.update_snapshots == 'true' - uses: actions/upload-artifact@v4 - with: - name: visual-snapshots-${{ inputs.platform_branch }} - path: custom/plugins/${{ inputs.extension_name }}/tests/acceptance/snapshots/ - retention-days: 3 diff --git a/.github/actions/jest/action.yml b/.github/actions/jest/action.yml deleted file mode 100644 index 6c752741f..000000000 --- a/.github/actions/jest/action.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Jest -description: Set up the extension and run Jest - -inputs: - extension_name: - required: true - description: Extension directory name - -runs: - using: composite - steps: - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-admin-${{ hashFiles('src/Resources/app/administration/package-lock.json', 'tests/Jest/package-lock.json', 'tests/acceptance/package-lock.json') }} - - - name: Setup extension - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ inputs.extension_name }} - install: true - install-admin: true - install-storefront: false - extraRepositories: | - { - "${{ inputs.extension_name }}": { - "type": "path", - "url": "custom/plugins/${{ inputs.extension_name }}", - "symlink": true - } - } - - - name: Run Jest - shell: bash - run: | - composer -d custom/plugins/${{ inputs.extension_name }} run admin:install - composer -d custom/plugins/${{ inputs.extension_name }} run admin:unit -- --ci diff --git a/.github/actions/phpstan/action.yml b/.github/actions/phpstan/action.yml deleted file mode 100644 index 63a315a47..000000000 --- a/.github/actions/phpstan/action.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: PHPStan -description: Set up the extension and run PHPStan - -inputs: - extension_name: - required: true - description: Extension directory name - -runs: - using: composite - steps: - - name: Setup extension - uses: shopware/github-actions/setup-extension@main - env: - DATABASE_URL: mysql://root@127.0.0.1/shopware - with: - extensionName: ${{ inputs.extension_name }} - install: true - install-admin: true - install-storefront: true - extraRepositories: | - { - "${{ inputs.extension_name }}": { - "type": "path", - "url": "custom/plugins/${{ inputs.extension_name }}", - "symlink": true - } - } - - - name: Create phpstan.neon - working-directory: custom/plugins/${{ inputs.extension_name }} - shell: bash - run: | - printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon - - - name: PHPStan cache - uses: actions/cache@v4 - with: - path: ${{ github.workspace }}/var/phpstan - key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ github.repository }}-phpstan- - - - name: Build PHPStan Bootstrap - shell: bash - run: php ${GITHUB_WORKSPACE}/src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php - - - name: Run PHPStan - shell: bash - run: | - composer -d custom/plugins/${{ inputs.extension_name }} dump-autoload --dev - composer -d custom/plugins/${{ inputs.extension_name }} run phpstan diff --git a/.github/actions/phpunit/action.yml b/.github/actions/phpunit/action.yml deleted file mode 100644 index 2d6f17079..000000000 --- a/.github/actions/phpunit/action.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: PHPUnit -description: Set up the extension and run PHPUnit - -inputs: - extension_name: - required: true - description: Extension directory name - platform_branch: - required: true - description: Shopware version to install - -runs: - using: composite - steps: - - name: Setup extension - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ inputs.extension_name }} - install: true - shopwareVersion: ${{ inputs.platform_branch }} - extraRepositories: | - { - "${{ inputs.extension_name }}": { - "type": "path", - "url": "custom/plugins/${{ inputs.extension_name }}", - "symlink": true - } - } - - - name: Import SW5 TestData DB - working-directory: custom/plugins/${{ inputs.extension_name }}/tests - shell: bash - run: mysql -uroot < _fixtures/database/shopware55.sql - - - name: Run PHPUnit - working-directory: custom/plugins/${{ inputs.extension_name }} - shell: bash - run: php -d pcov.enabled=1 -d pcov.directory=${PWD} -d pcov.exclude='~(vendor|tests|node_modules)~' ${GITHUB_WORKSPACE}/vendor/bin/phpunit --configuration phpunit.xml.dist diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml deleted file mode 100644 index 1b2386f8c..000000000 --- a/.github/workflows/acceptance.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Acceptance - -env: - EXTENSION_NAME: ${{ github.event.repository.name }} - PLATFORM_BRANCH: trunk - -on: - workflow_dispatch: - inputs: - update_snapshots: - description: Update snapshots - required: false - type: boolean - default: false - push: - branches: - - trunk - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - playwright: - name: Playwright - runs-on: ubuntu-latest - services: - mysql: - image: mysql:8.0 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: shopware - ports: - - 3306:3306 - env: - DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run Playwright - uses: ./.github/actions/acceptance - with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} - update_snapshots: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.update_snapshots == 'true' }} diff --git a/.github/workflows/action-acceptance.yml b/.github/workflows/action-acceptance.yml new file mode 100644 index 000000000..0008240da --- /dev/null +++ b/.github/workflows/action-acceptance.yml @@ -0,0 +1,98 @@ +name: Reusable Acceptance + +on: + workflow_call: + inputs: + extension_name: + required: true + type: string + platform_branch: + required: true + type: string + update_snapshots: + required: false + type: boolean + default: false + +jobs: + playwright: + name: Playwright + runs-on: ubuntu-latest + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: shopware + ports: + - 3306:3306 + env: + DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware + steps: + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-acceptance-${{ hashFiles('tests/acceptance/package-lock.json') }} + + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ hashFiles('custom/plugins/**/tests/acceptance/package-lock.json') }} + + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ inputs.extension_name }} + shopwareVersion: ${{ inputs.platform_branch }} + install: true + install-admin: true + install-storefront: false + mysqlVersion: skip + env: prod + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + + - name: Setup Migration Assistant + run: | + composer run build:js:admin + cd custom/plugins/${{ inputs.extension_name }}/tests + mysql -uroot < _fixtures/database/shopware55corrupted.sql + + - name: Install Playwright + working-directory: custom/plugins/${{ inputs.extension_name }}/tests/acceptance + run: | + npm ci + npx playwright install --with-deps + + - name: Run Playwright + working-directory: custom/plugins/${{ inputs.extension_name }}/tests/acceptance + env: + DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware55 + UPDATE_SNAPSHOTS: ${{ inputs.update_snapshots }} + run: npm run test + + - name: Upload test artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: e2e-${{ inputs.extension_name }}-${{ github.sha }}-${{ inputs.platform_branch }} + path: | + custom/plugins/${{ inputs.extension_name }}/tests/acceptance/test-results/ + custom/plugins/${{ inputs.extension_name }}/tests/acceptance/playwright-report/ + retention-days: 3 + + - name: Upload updated snapshots + if: inputs.update_snapshots + uses: actions/upload-artifact@v4 + with: + name: visual-snapshots-${{ inputs.platform_branch }} + path: custom/plugins/${{ inputs.extension_name }}/tests/acceptance/snapshots/ + retention-days: 3 diff --git a/.github/workflows/action-jest.yml b/.github/workflows/action-jest.yml new file mode 100644 index 000000000..7db47d48b --- /dev/null +++ b/.github/workflows/action-jest.yml @@ -0,0 +1,42 @@ +name: Reusable Jest + +on: + workflow_call: + inputs: + extension_name: + required: true + type: string + +jobs: + jest: + name: Jest + runs-on: ubuntu-latest + env: + ARTIFACTS_PATH: ${{ github.workspace }}/development + steps: + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-admin-${{ hashFiles('src/Resources/app/administration/package-lock.json', 'tests/Jest/package-lock.json', 'tests/acceptance/package-lock.json') }} + + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ inputs.extension_name }} + install: true + install-admin: true + install-storefront: false + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + + - name: Run Jest + uses: shopware/github-actions/admin-jest@main + with: + extensionName: ${{ inputs.extension_name }} diff --git a/.github/workflows/action-phpstan.yml b/.github/workflows/action-phpstan.yml new file mode 100644 index 000000000..c611cfa29 --- /dev/null +++ b/.github/workflows/action-phpstan.yml @@ -0,0 +1,52 @@ +name: Reusable PHPStan + +on: + workflow_call: + inputs: + extension_name: + required: true + type: string + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + env: + DATABASE_URL: mysql://root@127.0.0.1/shopware + with: + extensionName: ${{ inputs.extension_name }} + install: true + install-admin: true + install-storefront: true + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + + - name: Create phpstan.neon + working-directory: custom/plugins/${{ inputs.extension_name }} + run: | + printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon + + - name: PHPStan cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/var/phpstan + key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ github.repository }}-phpstan- + + - name: Build PHPStan bootstrap + run: php ${GITHUB_WORKSPACE}/src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php + + - name: Run PHPStan + run: | + composer -d custom/plugins/${{ inputs.extension_name }} dump-autoload --dev + composer -d custom/plugins/${{ inputs.extension_name }} run phpstan diff --git a/.github/workflows/action-phpunit.yml b/.github/workflows/action-phpunit.yml new file mode 100644 index 000000000..e9f4e2593 --- /dev/null +++ b/.github/workflows/action-phpunit.yml @@ -0,0 +1,40 @@ +name: Reusable PHPUnit + +on: + workflow_call: + inputs: + extension_name: + required: true + type: string + platform_branch: + required: true + type: string + +jobs: + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + steps: + - name: Setup extension + uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ inputs.extension_name }} + install: true + shopwareVersion: ${{ inputs.platform_branch }} + extraRepositories: | + { + "${{ inputs.extension_name }}": { + "type": "path", + "url": "custom/plugins/${{ inputs.extension_name }}", + "symlink": true + } + } + + - name: Import SW5 test data DB + working-directory: custom/plugins/${{ inputs.extension_name }}/tests + run: mysql -uroot < _fixtures/database/shopware55.sql + + - name: Run PHPUnit + uses: shopware/github-actions/phpunit@main + with: + extensionName: ${{ inputs.extension_name }} diff --git a/.github/workflows/ci-acceptance.yml b/.github/workflows/ci-acceptance.yml new file mode 100644 index 000000000..6870959f5 --- /dev/null +++ b/.github/workflows/ci-acceptance.yml @@ -0,0 +1,31 @@ +name: Acceptance + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + PLATFORM_BRANCH: trunk + +on: + workflow_dispatch: + inputs: + update_snapshots: + description: Update snapshots + required: false + type: boolean + default: false + push: + branches: + - trunk + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + playwright: + name: Playwright + uses: ./.github/workflows/action-acceptance.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + update_snapshots: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.update_snapshots == 'true' }} diff --git a/.github/workflows/admin.yml b/.github/workflows/ci-admin.yml similarity index 86% rename from .github/workflows/admin.yml rename to .github/workflows/ci-admin.yml index 52cb7bcb4..d1ac8c66a 100644 --- a/.github/workflows/admin.yml +++ b/.github/workflows/ci-admin.yml @@ -12,7 +12,6 @@ on: paths: - src/Resources/app/administration/** - tests/Jest/** - - .github/actions/** - .github/workflows/** concurrency: @@ -74,14 +73,6 @@ jobs: jest: name: Jest - runs-on: ubuntu-latest - env: - ARTIFACTS_PATH: ${{ github.workspace }}/development - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run Jest - uses: ./.github/actions/jest - with: - extension_name: ${{ env.EXTENSION_NAME }} + uses: ./.github/workflows/action-jest.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/ci-check-pr-title.yml similarity index 100% rename from .github/workflows/check-pr-title.yml rename to .github/workflows/ci-check-pr-title.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/ci-integration.yml similarity index 85% rename from .github/workflows/integration.yml rename to .github/workflows/ci-integration.yml index a74fd2551..4f9a388f4 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/ci-integration.yml @@ -44,16 +44,10 @@ jobs: phpunit: name: PHPUnit - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run PHPUnit - uses: ./.github/actions/phpunit - with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} + uses: ./.github/workflows/action-phpunit.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} smoke_test: name: Smoke test diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml new file mode 100644 index 000000000..585e94f32 --- /dev/null +++ b/.github/workflows/ci-nightly.yml @@ -0,0 +1,42 @@ +name: Nightly + +env: + EXTENSION_NAME: ${{ github.event.repository.name }} + PLATFORM_BRANCH: trunk + +on: + schedule: + - cron: '0 1 * * *' + workflow_dispatch: + +concurrency: + group: nightly-${{ github.ref }} + cancel-in-progress: false + +jobs: + phpstan: + name: PHPStan + uses: ./.github/workflows/action-phpstan.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} + + phpunit: + name: PHPUnit + uses: ./.github/workflows/action-phpunit.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + + jest: + name: Jest + uses: ./.github/workflows/action-jest.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} + + acceptance: + name: Playwright + uses: ./.github/workflows/action-acceptance.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} + platform_branch: ${{ env.PLATFORM_BRANCH }} + update_snapshots: false diff --git a/.github/workflows/php.yml b/.github/workflows/ci-php.yml similarity index 68% rename from .github/workflows/php.yml rename to .github/workflows/ci-php.yml index 6f86bd378..fdf5de0ad 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/ci-php.yml @@ -13,7 +13,6 @@ on: - composer.json - src/**/*.php - tests/**/*.php - - .github/actions/** - .github/workflows/** concurrency: @@ -31,12 +30,6 @@ jobs: phpstan: name: PHPStan - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run PHPStan - uses: ./.github/actions/phpstan - with: - extension_name: ${{ env.EXTENSION_NAME }} + uses: ./.github/workflows/action-phpstan.yml + with: + extension_name: ${{ env.EXTENSION_NAME }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index faa288c3d..000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Nightly - -env: - EXTENSION_NAME: ${{ github.event.repository.name }} - PLATFORM_BRANCH: trunk - -on: - schedule: - - cron: '0 1 * * *' - workflow_dispatch: - -concurrency: - group: nightly-${{ github.ref }} - cancel-in-progress: false - -jobs: - phpstan: - name: PHPStan - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run PHPStan - uses: ./.github/actions/phpstan - with: - extension_name: ${{ env.EXTENSION_NAME }} - - phpunit: - name: PHPUnit - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run PHPUnit - uses: ./.github/actions/phpunit - with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} - - jest: - name: Jest - runs-on: ubuntu-latest - env: - ARTIFACTS_PATH: ${{ github.workspace }}/development - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run Jest - uses: ./.github/actions/jest - with: - extension_name: ${{ env.EXTENSION_NAME }} - - acceptance: - name: Playwright - runs-on: ubuntu-latest - services: - mysql: - image: mysql:8.0 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: shopware - ports: - - 3306:3306 - env: - DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Run Playwright - uses: ./.github/actions/acceptance - with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} - update_snapshots: false From 084177331986736a15ab2a4c307fb3e41cb9542f Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 10:34:50 +0200 Subject: [PATCH 05/21] chore: debug --- src/Migration/DisplayWarning.php | 2 ++ src/Resources/app/administration/src/main.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Migration/DisplayWarning.php b/src/Migration/DisplayWarning.php index 3d0ca912c..31ff8ffd4 100644 --- a/src/Migration/DisplayWarning.php +++ b/src/Migration/DisplayWarning.php @@ -13,6 +13,8 @@ #[Package('fundamentals@after-sales')] class DisplayWarning extends Struct { + // test change + /** * @param string[] $snippetArguments */ diff --git a/src/Resources/app/administration/src/main.ts b/src/Resources/app/administration/src/main.ts index 0a509ed85..835caa587 100644 --- a/src/Resources/app/administration/src/main.ts +++ b/src/Resources/app/administration/src/main.ts @@ -6,3 +6,5 @@ import './type/global.types'; import './init/translation.init'; import './core/service'; import './module/swag-migration'; + +// test change From daba6565674cb9045bd5995fa027032153359e29 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 10:40:33 +0200 Subject: [PATCH 06/21] ci: debug --- .github/workflows/{ci-acceptance.yml => acceptance.yaml} | 0 .github/workflows/{ci-admin.yml => admin.yaml} | 0 .github/workflows/{ci-check-pr-title.yml => check-pr-title.yml} | 0 .github/workflows/{ci-integration.yml => integration.yaml} | 0 .github/workflows/{ci-nightly.yml => nightly.yaml} | 0 .github/workflows/{ci-php.yml => php.yaml} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci-acceptance.yml => acceptance.yaml} (100%) rename .github/workflows/{ci-admin.yml => admin.yaml} (100%) rename .github/workflows/{ci-check-pr-title.yml => check-pr-title.yml} (100%) rename .github/workflows/{ci-integration.yml => integration.yaml} (100%) rename .github/workflows/{ci-nightly.yml => nightly.yaml} (100%) rename .github/workflows/{ci-php.yml => php.yaml} (100%) diff --git a/.github/workflows/ci-acceptance.yml b/.github/workflows/acceptance.yaml similarity index 100% rename from .github/workflows/ci-acceptance.yml rename to .github/workflows/acceptance.yaml diff --git a/.github/workflows/ci-admin.yml b/.github/workflows/admin.yaml similarity index 100% rename from .github/workflows/ci-admin.yml rename to .github/workflows/admin.yaml diff --git a/.github/workflows/ci-check-pr-title.yml b/.github/workflows/check-pr-title.yml similarity index 100% rename from .github/workflows/ci-check-pr-title.yml rename to .github/workflows/check-pr-title.yml diff --git a/.github/workflows/ci-integration.yml b/.github/workflows/integration.yaml similarity index 100% rename from .github/workflows/ci-integration.yml rename to .github/workflows/integration.yaml diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/nightly.yaml similarity index 100% rename from .github/workflows/ci-nightly.yml rename to .github/workflows/nightly.yaml diff --git a/.github/workflows/ci-php.yml b/.github/workflows/php.yaml similarity index 100% rename from .github/workflows/ci-php.yml rename to .github/workflows/php.yaml From 42deaa2b624489fd214650b86fbeb0ce8cd03c96 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 10:45:05 +0200 Subject: [PATCH 07/21] ci: debug --- .github/workflows/acceptance.yaml | 8 ++------ .github/workflows/admin.yaml | 2 +- .github/workflows/integration.yaml | 4 ++-- .github/workflows/nightly.yaml | 16 ++++++---------- .github/workflows/php.yaml | 5 +---- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/acceptance.yaml b/.github/workflows/acceptance.yaml index 6870959f5..5be62bc7a 100644 --- a/.github/workflows/acceptance.yaml +++ b/.github/workflows/acceptance.yaml @@ -1,9 +1,5 @@ name: Acceptance -env: - EXTENSION_NAME: ${{ github.event.repository.name }} - PLATFORM_BRANCH: trunk - on: workflow_dispatch: inputs: @@ -26,6 +22,6 @@ jobs: name: Playwright uses: ./.github/workflows/action-acceptance.yml with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} + extension_name: ${{ github.event.repository.name }} + platform_branch: trunk update_snapshots: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.update_snapshots == 'true' }} diff --git a/.github/workflows/admin.yaml b/.github/workflows/admin.yaml index d1ac8c66a..475a58c30 100644 --- a/.github/workflows/admin.yaml +++ b/.github/workflows/admin.yaml @@ -75,4 +75,4 @@ jobs: name: Jest uses: ./.github/workflows/action-jest.yml with: - extension_name: ${{ env.EXTENSION_NAME }} + extension_name: ${{ github.event.repository.name }} diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 4f9a388f4..5d12bd8cd 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -46,8 +46,8 @@ jobs: name: PHPUnit uses: ./.github/workflows/action-phpunit.yml with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} + extension_name: ${{ github.event.repository.name }} + platform_branch: trunk smoke_test: name: Smoke test diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 585e94f32..93f1820fa 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,9 +1,5 @@ name: Nightly -env: - EXTENSION_NAME: ${{ github.event.repository.name }} - PLATFORM_BRANCH: trunk - on: schedule: - cron: '0 1 * * *' @@ -18,25 +14,25 @@ jobs: name: PHPStan uses: ./.github/workflows/action-phpstan.yml with: - extension_name: ${{ env.EXTENSION_NAME }} + extension_name: ${{ github.event.repository.name }} phpunit: name: PHPUnit uses: ./.github/workflows/action-phpunit.yml with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} + extension_name: ${{ github.event.repository.name }} + platform_branch: trunk jest: name: Jest uses: ./.github/workflows/action-jest.yml with: - extension_name: ${{ env.EXTENSION_NAME }} + extension_name: ${{ github.event.repository.name }} acceptance: name: Playwright uses: ./.github/workflows/action-acceptance.yml with: - extension_name: ${{ env.EXTENSION_NAME }} - platform_branch: ${{ env.PLATFORM_BRANCH }} + extension_name: ${{ github.event.repository.name }} + platform_branch: trunk update_snapshots: false diff --git a/.github/workflows/php.yaml b/.github/workflows/php.yaml index fdf5de0ad..25e13e53f 100644 --- a/.github/workflows/php.yaml +++ b/.github/workflows/php.yaml @@ -1,8 +1,5 @@ name: PHP Checks -env: - EXTENSION_NAME: ${{ github.event.repository.name }} - on: workflow_dispatch: push: @@ -32,4 +29,4 @@ jobs: name: PHPStan uses: ./.github/workflows/action-phpstan.yml with: - extension_name: ${{ env.EXTENSION_NAME }} + extension_name: ${{ github.event.repository.name }} From c0a9189a4fcd710dd76886cedb2590c87f0f792b Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 10:57:11 +0200 Subject: [PATCH 08/21] ci: debug --- .github/workflows/action-jest.yml | 11 +++++++---- .github/workflows/action-phpunit.yml | 4 +--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/action-jest.yml b/.github/workflows/action-jest.yml index 7db47d48b..fceb54451 100644 --- a/.github/workflows/action-jest.yml +++ b/.github/workflows/action-jest.yml @@ -18,7 +18,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.npm - key: ${{ runner.os }}-admin-${{ hashFiles('src/Resources/app/administration/package-lock.json', 'tests/Jest/package-lock.json', 'tests/acceptance/package-lock.json') }} + key: ${{ runner.os }}-jest-${{ hashFiles('tests/Jest/package-lock.json') }} - name: Setup extension uses: shopware/github-actions/setup-extension@main @@ -36,7 +36,10 @@ jobs: } } + - name: Install Jest dependencies + working-directory: custom/plugins/${{ inputs.extension_name }}/tests/Jest + run: npm ci + - name: Run Jest - uses: shopware/github-actions/admin-jest@main - with: - extensionName: ${{ inputs.extension_name }} + working-directory: custom/plugins/${{ inputs.extension_name }}/tests/Jest + run: npm run unit diff --git a/.github/workflows/action-phpunit.yml b/.github/workflows/action-phpunit.yml index e9f4e2593..13144fd24 100644 --- a/.github/workflows/action-phpunit.yml +++ b/.github/workflows/action-phpunit.yml @@ -35,6 +35,4 @@ jobs: run: mysql -uroot < _fixtures/database/shopware55.sql - name: Run PHPUnit - uses: shopware/github-actions/phpunit@main - with: - extensionName: ${{ inputs.extension_name }} + run: composer -d custom/plugins/${{ inputs.extension_name }} run phpunit From c3198133eddb1e61695c94f35b3797c7bd1cd5c3 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 14:24:39 +0200 Subject: [PATCH 09/21] ci: add slack notification --- .github/workflows/nightly.yaml | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 93f1820fa..ede6224de 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -36,3 +36,68 @@ jobs: extension_name: ${{ github.event.repository.name }} platform_branch: trunk update_snapshots: false + + notify_slack_on_schedule_failure: + name: Slack Notify + runs-on: ubuntu-latest + needs: + - phpstan + - phpunit + - jest + - acceptance + if: >- + ${{ + always() && + github.event_name == 'schedule' && + ( + needs.phpstan.result == 'failure' || + needs.phpunit.result == 'failure' || + needs.jest.result == 'failure' || + needs.acceptance.result == 'failure' + ) + }} + steps: + - name: Notify Slack + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + RUN_NUMBER: ${{ github.run_number }} + REPOSITORY: ${{ github.repository }} + BRANCH: ${{ github.ref_name }} + PHPSTAN_RESULT: ${{ needs.phpstan.result }} + PHPUNIT_RESULT: ${{ needs.phpunit.result }} + JEST_RESULT: ${{ needs.jest.result }} + ACCEPTANCE_RESULT: ${{ needs.acceptance.result }} + run: | + set -euo pipefail + + failed_jobs=() + + [ "$PHPSTAN_RESULT" = "failure" ] && failed_jobs+=("PHPStan") + [ "$PHPUNIT_RESULT" = "failure" ] && failed_jobs+=("PHPUnit") + [ "$JEST_RESULT" = "failure" ] && failed_jobs+=("Jest") + [ "$ACCEPTANCE_RESULT" = "failure" ] && failed_jobs+=("Playwright") + + failed_jobs_list=$(printf -- '- %s\n' "${failed_jobs[@]}") + failed_jobs_list=${failed_jobs_list%$'\n'} + + payload=$( + jq -nc \ + --arg repository "$REPOSITORY" \ + --arg branch "$BRANCH" \ + --arg run_number "$RUN_NUMBER" \ + --arg failed_jobs_list "$failed_jobs_list" \ + --arg run_url "$RUN_URL" \ + '{ + repository: $repository, + branch: $branch, + run_number: $run_number, + failed_jobs_list: $failed_jobs_list, + run_url: $run_url + }' + ) + + curl -fsSL -X POST \ + -H 'Content-type: application/json' \ + --data "$payload" \ + "$SLACK_WEBHOOK_URL" From 504811ebaab1c59c5289db96f2ce66d15e24100e Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 14:28:08 +0200 Subject: [PATCH 10/21] ci: test --- .github/workflows/nightly.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index ede6224de..12fef8fdf 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -3,6 +3,9 @@ name: Nightly on: schedule: - cron: '0 1 * * *' + pull_request: + paths: + - '.github/workflows/nightly.yaml' workflow_dispatch: concurrency: @@ -48,7 +51,11 @@ jobs: if: >- ${{ always() && - github.event_name == 'schedule' && + ( + github.event_name == 'schedule' || + github.event_name == 'pull_request' || + github.event_name == 'workflow_dispatch' + ) && ( needs.phpstan.result == 'failure' || needs.phpunit.result == 'failure' || From fe3853b63d4d6e369200b7e3821015df28e95d4f Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 15:13:28 +0200 Subject: [PATCH 11/21] fix: revert debug --- .github/workflows/admin.yaml | 71 +++++++++++++--------------------- .github/workflows/nightly.yaml | 15 ++----- 2 files changed, 31 insertions(+), 55 deletions(-) diff --git a/.github/workflows/admin.yaml b/.github/workflows/admin.yaml index 475a58c30..56d9dc56e 100644 --- a/.github/workflows/admin.yaml +++ b/.github/workflows/admin.yaml @@ -20,56 +20,39 @@ concurrency: jobs: lint: - name: Lint + name: Lint and formatting checks runs-on: ubuntu-latest steps: - - name: Setup extension - uses: shopware/github-actions/setup-extension@main - with: - extensionName: ${{ env.EXTENSION_NAME }} - install: true - install-admin: true - install-storefront: false - extraRepositories: | - { - "${{ env.EXTENSION_NAME }}": { - "type": "path", - "url": "custom/plugins/${{ env.EXTENSION_NAME }}", - "symlink": true - } - } - - - name: Run lint and formatting checks - run: | - composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install - composer -d custom/plugins/${{ env.EXTENSION_NAME }} run lint:admin - composer -d custom/plugins/${{ env.EXTENSION_NAME }} run format:admin - composer -d custom/plugins/${{ env.EXTENSION_NAME }} run format:md + - name: Checkout repository + uses: actions/checkout@v4 - stylelint: - name: Stylelint - runs-on: ubuntu-latest - steps: - - name: Setup extension - uses: shopware/github-actions/setup-extension@main + - name: Setup Node.js + uses: actions/setup-node@v4 with: - extensionName: ${{ env.EXTENSION_NAME }} - install: true - install-admin: true - install-storefront: false - extraRepositories: | - { - "${{ env.EXTENSION_NAME }}": { - "type": "path", - "url": "custom/plugins/${{ env.EXTENSION_NAME }}", - "symlink": true - } - } + node-version: 20 + cache: npm + cache-dependency-path: | + src/Resources/app/administration/package-lock.json + tests/Jest/package-lock.json + tests/acceptance/package-lock.json + + - name: Install admin dependencies + run: | + npm ci --prefix src/Resources/app/administration + npm ci --prefix tests/Jest + npm ci --prefix tests/acceptance - - name: Run stylelint + - name: Run lint and formatting checks run: | - composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install - composer -d custom/plugins/${{ env.EXTENSION_NAME }} run lint:admin:scss + npm run lint --prefix tests/Jest + npm run lint --prefix src/Resources/app/administration + npm run lint --prefix tests/acceptance + npm run lint:scss --prefix src/Resources/app/administration + npm run format --prefix tests/Jest + npm run format --prefix src/Resources/app/administration + npm run format --prefix tests/acceptance + npm run format:md --prefix src/Resources/app/administration + npm run format:yml --prefix src/Resources/app/administration jest: name: Jest diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 12fef8fdf..6e001aff3 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -3,9 +3,6 @@ name: Nightly on: schedule: - cron: '0 1 * * *' - pull_request: - paths: - - '.github/workflows/nightly.yaml' workflow_dispatch: concurrency: @@ -51,11 +48,7 @@ jobs: if: >- ${{ always() && - ( - github.event_name == 'schedule' || - github.event_name == 'pull_request' || - github.event_name == 'workflow_dispatch' - ) && + github.event_name == 'schedule' && ( needs.phpstan.result == 'failure' || needs.phpunit.result == 'failure' || @@ -68,7 +61,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - RUN_NUMBER: ${{ github.run_number }} + RUN_ID: ${{ github.run_id }} REPOSITORY: ${{ github.repository }} BRANCH: ${{ github.ref_name }} PHPSTAN_RESULT: ${{ needs.phpstan.result }} @@ -92,13 +85,13 @@ jobs: jq -nc \ --arg repository "$REPOSITORY" \ --arg branch "$BRANCH" \ - --arg run_number "$RUN_NUMBER" \ + --arg run_id "$RUN_ID" \ --arg failed_jobs_list "$failed_jobs_list" \ --arg run_url "$RUN_URL" \ '{ repository: $repository, branch: $branch, - run_number: $run_number, + run_id: $run_id, failed_jobs_list: $failed_jobs_list, run_url: $run_url }' From b20425749091bba75fb51812fe8cf91c5c61c703 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 15:37:37 +0200 Subject: [PATCH 12/21] ci: debug again --- .github/workflows/nightly.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 6e001aff3..628422406 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -3,6 +3,9 @@ name: Nightly on: schedule: - cron: '0 1 * * *' + pull_request: + paths: + - '.github/workflows/nightly.yaml' workflow_dispatch: concurrency: @@ -48,7 +51,11 @@ jobs: if: >- ${{ always() && - github.event_name == 'schedule' && + ( + github.event_name == 'schedule' || + github.event_name == 'pull_request' || + github.event_name == 'workflow_dispatch' + ) && ( needs.phpstan.result == 'failure' || needs.phpunit.result == 'failure' || From 2da1e3016ce9eb282169bd83e4ad06e51ba2440a Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 15:41:33 +0200 Subject: [PATCH 13/21] ci: fail --- .../Migration/Controller/ErrorResolutionControllerTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php b/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php index fca5b55ec..85c2b8bed 100644 --- a/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php +++ b/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php @@ -7,6 +7,7 @@ namespace integration\Migration\Controller; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Shopware\Core\Defaults; @@ -24,6 +25,7 @@ * @internal */ #[Package('fundamentals@after-sales')] +#[CoversClass(ErrorResolutionController::class)] class ErrorResolutionControllerTest extends TestCase { use IntegrationTestBehaviour; From 1746bb6d571ad39d5aecd13295313affa92bc652 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Mon, 30 Mar 2026 16:11:25 +0200 Subject: [PATCH 14/21] ci: fix --- .github/workflows/nightly.yaml | 9 +-- tests/Jest/package-lock.json | 74 +++++++++++-------- tests/Jest/package.json | 1 + .../ErrorResolutionControllerTest.php | 2 - 4 files changed, 46 insertions(+), 40 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 628422406..6e001aff3 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -3,9 +3,6 @@ name: Nightly on: schedule: - cron: '0 1 * * *' - pull_request: - paths: - - '.github/workflows/nightly.yaml' workflow_dispatch: concurrency: @@ -51,11 +48,7 @@ jobs: if: >- ${{ always() && - ( - github.event_name == 'schedule' || - github.event_name == 'pull_request' || - github.event_name == 'workflow_dispatch' - ) && + github.event_name == 'schedule' && ( needs.phpstan.result == 'failure' || needs.phpunit.result == 'failure' || diff --git a/tests/Jest/package-lock.json b/tests/Jest/package-lock.json index a03e13c2f..d993f38fc 100644 --- a/tests/Jest/package-lock.json +++ b/tests/Jest/package-lock.json @@ -27,6 +27,7 @@ "jest": "30.2.0", "jest-environment-jsdom": "30.2.0", "jest-junit": "15.0.0", + "picomatch": "4.0.4", "prettier": "3.6.2", "prettier-plugin-multiline-arrays": "3.0.6", "typescript": "5.7.3" @@ -3262,6 +3263,19 @@ "node": ">= 10.13.0" } }, + "node_modules/@shopware-ag/jest-preset-sw6-admin/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@shopware-ag/jest-preset-sw6-admin/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -4134,6 +4148,19 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -7153,19 +7180,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-util/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/jest-validate": { "version": "30.2.0", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.2.0.tgz", @@ -7743,6 +7757,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -8151,13 +8178,13 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -8867,19 +8894,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/tldts": { "version": "6.1.86", "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", diff --git a/tests/Jest/package.json b/tests/Jest/package.json index ba71bdf71..af728745a 100644 --- a/tests/Jest/package.json +++ b/tests/Jest/package.json @@ -29,6 +29,7 @@ "jest": "30.2.0", "jest-environment-jsdom": "30.2.0", "jest-junit": "15.0.0", + "picomatch": "4.0.4", "prettier": "3.6.2", "prettier-plugin-multiline-arrays": "3.0.6", "typescript": "5.7.3", diff --git a/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php b/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php index 85c2b8bed..fca5b55ec 100644 --- a/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php +++ b/tests/integration/Migration/Controller/ErrorResolutionControllerTest.php @@ -7,7 +7,6 @@ namespace integration\Migration\Controller; -use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Shopware\Core\Defaults; @@ -25,7 +24,6 @@ * @internal */ #[Package('fundamentals@after-sales')] -#[CoversClass(ErrorResolutionController::class)] class ErrorResolutionControllerTest extends TestCase { use IntegrationTestBehaviour; From 03ceaacd7a12d4a0a31a69285900377b3628e1d1 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Wed, 1 Apr 2026 08:53:08 +0200 Subject: [PATCH 15/21] fix: add missing script --- src/Resources/app/administration/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/app/administration/package.json b/src/Resources/app/administration/package.json index 59b536ea9..3463fe904 100644 --- a/src/Resources/app/administration/package.json +++ b/src/Resources/app/administration/package.json @@ -11,7 +11,8 @@ "format": "npx prettier --check \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", "format:fix": "npx prettier --write \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", "format:md": "npx prettier --check \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", - "format:md:fix": "npx prettier --write \"../../../../*.md\" --config ../../../../.prettierrc.json --cache" + "format:md:fix": "npx prettier --write \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", + "format:yml": "npx prettier --check \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache" }, "devDependencies": { "@eslint/js": "9.39.3", From 13e050aade18dc0f7d19b620de1b0131646eccf3 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Wed, 1 Apr 2026 08:54:13 +0200 Subject: [PATCH 16/21] fix: revert test changes --- src/Migration/DisplayWarning.php | 2 -- src/Resources/app/administration/src/main.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Migration/DisplayWarning.php b/src/Migration/DisplayWarning.php index 31ff8ffd4..3d0ca912c 100644 --- a/src/Migration/DisplayWarning.php +++ b/src/Migration/DisplayWarning.php @@ -13,8 +13,6 @@ #[Package('fundamentals@after-sales')] class DisplayWarning extends Struct { - // test change - /** * @param string[] $snippetArguments */ diff --git a/src/Resources/app/administration/src/main.ts b/src/Resources/app/administration/src/main.ts index 835caa587..0a509ed85 100644 --- a/src/Resources/app/administration/src/main.ts +++ b/src/Resources/app/administration/src/main.ts @@ -6,5 +6,3 @@ import './type/global.types'; import './init/translation.init'; import './core/service'; import './module/swag-migration'; - -// test change From 36e66c0b56d86164e0377cbb178c4944eec4b041 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Wed, 1 Apr 2026 08:58:23 +0200 Subject: [PATCH 17/21] fix: write script --- src/Resources/app/administration/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/app/administration/package.json b/src/Resources/app/administration/package.json index 3463fe904..17f2cd6ed 100644 --- a/src/Resources/app/administration/package.json +++ b/src/Resources/app/administration/package.json @@ -12,7 +12,8 @@ "format:fix": "npx prettier --write \"src/**/*.{js,ts}\" --config ../../../../.prettierrc.json --cache", "format:md": "npx prettier --check \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", "format:md:fix": "npx prettier --write \"../../../../*.md\" --config ../../../../.prettierrc.json --cache", - "format:yml": "npx prettier --check \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache" + "format:yml": "npx prettier --check \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache", + "format:yml:fix": "npx prettier --write \"../../../../.github/**/*.{yml,yaml}\" --config ../../../../.prettierrc.json --cache" }, "devDependencies": { "@eslint/js": "9.39.3", From 432c23ebf2c659cf302da73a22d6cd6f69ed58f1 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Wed, 1 Apr 2026 10:56:24 +0200 Subject: [PATCH 18/21] ci: add reactivate workflow --- .github/workflows/reactivate-workflows.yml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/reactivate-workflows.yml diff --git a/.github/workflows/reactivate-workflows.yml b/.github/workflows/reactivate-workflows.yml new file mode 100644 index 000000000..9f49c8668 --- /dev/null +++ b/.github/workflows/reactivate-workflows.yml @@ -0,0 +1,24 @@ +name: Reactivate Workflows + +on: + schedule: + - cron: '0 0 1 * *' + workflow_dispatch: + +permissions: + actions: write + +jobs: + reactivate_workflow: + name: Reactivate Workflow + runs-on: ubuntu-latest + strategy: + matrix: + WORKFLOW: ['nightly.yaml', 'reactivate-workflows.yml'] + steps: + - name: Reactivate workflow + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + shell: bash + run: gh workflow enable "${{ matrix.WORKFLOW }}" From 7dbfcc9d20cbb655e2a48369c3e47d6c136fdebd Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Wed, 1 Apr 2026 18:09:33 +0200 Subject: [PATCH 19/21] ci: try to fix caching --- .github/workflows/action-acceptance.yml | 24 ++++++++++++------------ .github/workflows/action-jest.yml | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/action-acceptance.yml b/.github/workflows/action-acceptance.yml index 0008240da..798980b47 100644 --- a/.github/workflows/action-acceptance.yml +++ b/.github/workflows/action-acceptance.yml @@ -29,18 +29,6 @@ jobs: env: DATABASE_URL: mysql://root:root@127.0.0.1:3306/shopware steps: - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-acceptance-${{ hashFiles('tests/acceptance/package-lock.json') }} - - - name: Cache Playwright browsers - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ hashFiles('custom/plugins/**/tests/acceptance/package-lock.json') }} - - name: Setup extension uses: shopware/github-actions/setup-extension@main with: @@ -60,6 +48,18 @@ jobs: } } + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-acceptance-${{ hashFiles(format('custom/plugins/{0}/tests/acceptance/package-lock.json', inputs.extension_name)) }} + + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ hashFiles(format('custom/plugins/{0}/tests/acceptance/package-lock.json', inputs.extension_name)) }} + - name: Setup Migration Assistant run: | composer run build:js:admin diff --git a/.github/workflows/action-jest.yml b/.github/workflows/action-jest.yml index fceb54451..e39dbcfef 100644 --- a/.github/workflows/action-jest.yml +++ b/.github/workflows/action-jest.yml @@ -14,12 +14,6 @@ jobs: env: ARTIFACTS_PATH: ${{ github.workspace }}/development steps: - - name: Cache npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-jest-${{ hashFiles('tests/Jest/package-lock.json') }} - - name: Setup extension uses: shopware/github-actions/setup-extension@main with: @@ -36,6 +30,12 @@ jobs: } } + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-jest-${{ hashFiles(format('custom/plugins/{0}/tests/Jest/package-lock.json', inputs.extension_name)) }} + - name: Install Jest dependencies working-directory: custom/plugins/${{ inputs.extension_name }}/tests/Jest run: npm ci From 5f7667de6411833bdda167d0914734e44dea1ac9 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Wed, 1 Apr 2026 18:14:59 +0200 Subject: [PATCH 20/21] ci: raise cache version --- .github/workflows/action-acceptance.yml | 4 ++-- .github/workflows/action-jest.yml | 2 +- .github/workflows/action-phpstan.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action-acceptance.yml b/.github/workflows/action-acceptance.yml index 798980b47..031375665 100644 --- a/.github/workflows/action-acceptance.yml +++ b/.github/workflows/action-acceptance.yml @@ -49,13 +49,13 @@ jobs: } - name: Cache npm - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ~/.npm key: ${{ runner.os }}-acceptance-${{ hashFiles(format('custom/plugins/{0}/tests/acceptance/package-lock.json', inputs.extension_name)) }} - name: Cache Playwright browsers - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ~/.cache/ms-playwright key: playwright-${{ runner.os }}-${{ hashFiles(format('custom/plugins/{0}/tests/acceptance/package-lock.json', inputs.extension_name)) }} diff --git a/.github/workflows/action-jest.yml b/.github/workflows/action-jest.yml index e39dbcfef..f36ed4258 100644 --- a/.github/workflows/action-jest.yml +++ b/.github/workflows/action-jest.yml @@ -31,7 +31,7 @@ jobs: } - name: Cache npm - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ~/.npm key: ${{ runner.os }}-jest-${{ hashFiles(format('custom/plugins/{0}/tests/Jest/package-lock.json', inputs.extension_name)) }} diff --git a/.github/workflows/action-phpstan.yml b/.github/workflows/action-phpstan.yml index c611cfa29..e5f9e178b 100644 --- a/.github/workflows/action-phpstan.yml +++ b/.github/workflows/action-phpstan.yml @@ -36,7 +36,7 @@ jobs: printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon - name: PHPStan cache - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ github.workspace }}/var/phpstan key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }} From 5c0b9794c1be35de1b5a5978f2b716cb4112dce7 Mon Sep 17 00:00:00 2001 From: Lars Kemper Date: Thu, 2 Apr 2026 07:16:15 +0200 Subject: [PATCH 21/21] ci: pin cache version --- .github/workflows/action-acceptance.yml | 4 ++-- .github/workflows/action-jest.yml | 2 +- .github/workflows/action-phpstan.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action-acceptance.yml b/.github/workflows/action-acceptance.yml index 031375665..15319a9b0 100644 --- a/.github/workflows/action-acceptance.yml +++ b/.github/workflows/action-acceptance.yml @@ -49,13 +49,13 @@ jobs: } - name: Cache npm - uses: actions/cache@v5 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ~/.npm key: ${{ runner.os }}-acceptance-${{ hashFiles(format('custom/plugins/{0}/tests/acceptance/package-lock.json', inputs.extension_name)) }} - name: Cache Playwright browsers - uses: actions/cache@v5 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ~/.cache/ms-playwright key: playwright-${{ runner.os }}-${{ hashFiles(format('custom/plugins/{0}/tests/acceptance/package-lock.json', inputs.extension_name)) }} diff --git a/.github/workflows/action-jest.yml b/.github/workflows/action-jest.yml index f36ed4258..db59d032c 100644 --- a/.github/workflows/action-jest.yml +++ b/.github/workflows/action-jest.yml @@ -31,7 +31,7 @@ jobs: } - name: Cache npm - uses: actions/cache@v5 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ~/.npm key: ${{ runner.os }}-jest-${{ hashFiles(format('custom/plugins/{0}/tests/Jest/package-lock.json', inputs.extension_name)) }} diff --git a/.github/workflows/action-phpstan.yml b/.github/workflows/action-phpstan.yml index e5f9e178b..755301071 100644 --- a/.github/workflows/action-phpstan.yml +++ b/.github/workflows/action-phpstan.yml @@ -36,7 +36,7 @@ jobs: printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon - name: PHPStan cache - uses: actions/cache@v5 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ${{ github.workspace }}/var/phpstan key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }}