diff --git a/.github/actions/setup-paypal/action.yml b/.github/actions/setup-paypal/action.yml new file mode 100644 index 000000000..6de9d09fa --- /dev/null +++ b/.github/actions/setup-paypal/action.yml @@ -0,0 +1,97 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-action.json + +name: Setup SwagPayPal +description: "Setup steps for SwagPayPal" +author: "shopware AG" +branding: + color: "blue" + icon: "download" + +inputs: + install-admin: + default: "true" + required: false + description: "Should we install the Administration of shopware" + install-commercial: + default: "false" + required: false + description: "Should we install SwagCommercial" + install-storefront: + default: "true" + required: false + description: "Should we install the Storefront of shopware" + mysql-version: + default: "builtin" + required: false + description: "Which MySQL version should be used" + php-version: + default: "8.2" + required: false + description: "Which PHP version should be used" + shopware-version: + default: "trunk" + required: false + description: "Which version/branch of shopware should be used" + +runs: + using: composite + steps: + - uses: octo-sts/action@main + id: octo-sts + with: + scope: shopware + identity: ${{ github.event.repository.name }} + - name: Prepare dependency list + id: dependency-list + shell: bash + run: | + DEPS='[ + { + "name":"SwagCmsExtensions", + "repo": "https://github.com/shopware/SwagCmsExtensions.git", + "token": "${{ steps.octo-sts.outputs.token }}" + } + ]' + + REPOS='{ + "${{ github.event.repository.name }}": { + "type": "path", + "url": "custom/plugins/${{ github.event.repository.name }}", + "symlink": true + }, + "SwagCmsExtensions": { + "type": "path", + "url": "custom/plugins/SwagCmsExtensions", + "symlink": true + } + }' + + if [[ "${{ inputs.install-commercial }}" == "true" ]]; then + DEPS=$(jq -s 'add' <(echo $DEPS) <(echo '[ + { + "name":"SwagCommercial", + "repo": "https://github.com/shopware/SwagCommercial.git", + "branch": "${{ matrix.PLATFORM_BRANCH }}", + "token": "${{ steps.octo-sts.outputs.token }}" + }]')) + REPOS=$(jq -s 'add' <(echo $REPOS) <(echo '{ + "SwagCommercial": { + "type": "path", + "url": "custom/plugins/SwagCommercial", + "symlink": true + } + }')) + fi + echo "deps=$(echo $DEPS | jq -c .)" >> "$GITHUB_OUTPUT" + echo "repos=$(echo $REPOS | jq -c .)" >> "$GITHUB_OUTPUT" + - uses: shopware/github-actions/setup-extension@main + with: + extensionName: ${{ github.event.repository.name }} + mysqlVersion: ${{ inputs.mysql-version }} + shopwareVersion: ${{ inputs.shopware-version }} + phpVersion: ${{ inputs.php-version }} + install: true + install-admin: ${{ inputs.install-admin }} + install-storefront: ${{ inputs.install-storefront }} + dependencies: ${{ steps.dependency-list.outputs.deps }} + extraRepositories: ${{ steps.dependency-list.outputs.repos }} diff --git a/.github/workflows/admin.yml b/.github/workflows/admin.yml index 8a969a0df..1be869a63 100644 --- a/.github/workflows/admin.yml +++ b/.github/workflows/admin.yml @@ -15,47 +15,15 @@ jobs: eslint: runs-on: ubuntu-latest steps: - - uses: octo-sts/action@main - id: octo-sts + - name: Checkout SwagPayPal + uses: actions/checkout@v4 with: - scope: shopware - identity: ${{ github.event.repository.name }} - - uses: shopware/github-actions/setup-extension@main + path: custom/plugins/${{ github.event.repository.name }} + - name: Setup SwagPayPal + uses: ./custom/plugins/SwagPayPal/.github/actions/setup-paypal with: - extensionName: ${{ github.event.repository.name }} - install: true - installAdmin: true - dependencies: | - [ - { - "name":"SwagCommercial", - "repo": "https://github.com/shopware/SwagCommercial.git", - "token": "${{ steps.octo-sts.outputs.token }}" - }, - { - "name":"SwagCmsExtensions", - "repo": "https://github.com/shopware/SwagCmsExtensions.git", - "token": "${{ steps.octo-sts.outputs.token }}" - } - ] - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - }, - "SwagCommercial": { - "type": "path", - "url": "custom/plugins/SwagCommercial", - "symlink": true - }, - "SwagCmsExtensions": { - "type": "path", - "url": "custom/plugins/SwagCmsExtensions", - "symlink": true - } - } + install-commercial: true + install-storefront: false - name: Prepare ESLint run: | bin/console bundle:dump diff --git a/.github/workflows/intergration.yml b/.github/workflows/intergration.yml index 21c4a6c76..d38866cf3 100644 --- a/.github/workflows/intergration.yml +++ b/.github/workflows/intergration.yml @@ -33,65 +33,17 @@ jobs: ports: - "6379:6379" steps: - - uses: octo-sts/action@main - id: octo-sts + - name: Checkout SwagPayPal + uses: actions/checkout@v4 with: - scope: shopware - identity: ${{ github.event.repository.name }} - - name: Prepare dependency list - id: dependency-list - shell: bash - run: | - DEPS='[ - { - "name":"SwagCmsExtensions", - "repo": "https://github.com/shopware/SwagCmsExtensions.git", - "token": "${{ steps.octo-sts.outputs.token }}" - } - ]' - - REPOS='{ - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - }, - "SwagCmsExtensions": { - "type": "path", - "url": "custom/plugins/SwagCmsExtensions", - "symlink": true - } - }' - - if [[ "${{ matrix.WITH_COMMERCIAL }}" == "true" ]]; then - DEPS=$(jq -s 'add' <(echo $DEPS) <(echo '[ - { - "name":"SwagCommercial", - "repo": "https://github.com/shopware/SwagCommercial.git", - "branch": "${{ matrix.PLATFORM_BRANCH }}", - "token": "${{ steps.octo-sts.outputs.token }}" - }]')) - REPOS=$(jq -s 'add' <(echo $REPOS) <(echo '{ - "SwagCommercial": { - "type": "path", - "url": "custom/plugins/SwagCommercial", - "symlink": true - } - }')) - fi - echo "deps=$(echo $DEPS | jq -c .)" >> "$GITHUB_OUTPUT" - echo "repos=$(echo $REPOS | jq -c .)" >> "$GITHUB_OUTPUT" - - uses: shopware/github-actions/setup-extension@main + path: custom/plugins/${{ github.event.repository.name }} + - name: Setup SwagPayPal + uses: ./custom/plugins/SwagPayPal/.github/actions/setup-paypal with: - extensionName: ${{ github.event.repository.name }} - mysqlVersion: ${{ matrix.MYSQL_IMAGE }} - shopwareVersion: ${{ matrix.PLATFORM_BRANCH }} - phpVersion: ${{ matrix.PHP_VERSION }} - install: true - installAdmin: true - installStorefront: true - dependencies: ${{steps.dependency-list.outputs.deps}} - extraRepositories: ${{steps.dependency-list.outputs.repos}} + install-commercial: ${{ matrix.WITH_COMMERCIAL }} + mysql-version: ${{ matrix.MYSQL_IMAGE }} + php-version: ${{ matrix.PHP_VERSION }} + shopware-version: ${{ matrix.PLATFORM_BRANCH }} - name: Run PHPUnit working-directory: custom/plugins/${{ github.event.repository.name }} run: | diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8f400050c..4d8d4325f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,49 +21,15 @@ jobs: PLATFORM_BRANCH: ["6.6.0.0", "trunk"] fail-fast: false steps: - - uses: octo-sts/action@main - id: octo-sts + - name: Checkout SwagPayPal + uses: actions/checkout@v4 with: - scope: shopware - identity: ${{ github.event.repository.name }} - - uses: shopware/github-actions/setup-extension@main + path: custom/plugins/${{ github.event.repository.name }} + - name: Setup SwagPayPal + uses: ./custom/plugins/SwagPayPal/.github/actions/setup-paypal with: - extensionName: ${{ github.event.repository.name }} - install: true - installAdmin: true - installStorefront: true - dependencies: | - [ - { - "name":"SwagCommercial", - "repo": "https://github.com/shopware/SwagCommercial.git", - "token": "${{ steps.octo-sts.outputs.token }}" - }, - { - "name":"SwagCmsExtensions", - "repo": "https://github.com/shopware/SwagCmsExtensions.git", - "token": "${{ steps.octo-sts.outputs.token }}" - } - ] - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - }, - "SwagCommercial": { - "type": "path", - "url": "custom/plugins/SwagCommercial", - "symlink": true - }, - "SwagCmsExtensions": { - "type": "path", - "url": "custom/plugins/SwagCmsExtensions", - "symlink": true - } - } - + install-commercial: true + shopware-version: ${{ matrix.PLATFORM_BRANCH }} - name: Prepare phpstan working-directory: custom/plugins/${{ github.event.repository.name }} run: | diff --git a/.github/workflows/storefront.yml b/.github/workflows/storefront.yml index e6612297d..04d9363dc 100644 --- a/.github/workflows/storefront.yml +++ b/.github/workflows/storefront.yml @@ -15,47 +15,14 @@ jobs: eslint: runs-on: ubuntu-latest steps: - - uses: octo-sts/action@main - id: octo-sts + - name: Checkout SwagPayPal + uses: actions/checkout@v4 with: - scope: shopware - identity: ${{ github.event.repository.name }} - - uses: shopware/github-actions/setup-extension@main + path: custom/plugins/${{ github.event.repository.name }} + - name: Setup SwagPayPal + uses: ./custom/plugins/SwagPayPal/.github/actions/setup-paypal with: - extensionName: ${{ github.event.repository.name }} - install: true - installStorefront: true - dependencies: | - [ - { - "name":"SwagCommercial", - "repo": "https://github.com/shopware/SwagCommercial.git", - "token": "${{ steps.octo-sts.outputs.token }}" - }, - { - "name":"SwagCmsExtensions", - "repo": "https://github.com/shopware/SwagCmsExtensions.git", - "token": "${{ steps.octo-sts.outputs.token }}" - } - ] - extraRepositories: | - { - "${{ github.event.repository.name }}": { - "type": "path", - "url": "custom/plugins/${{ github.event.repository.name }}", - "symlink": true - }, - "SwagCommercial": { - "type": "path", - "url": "custom/plugins/SwagCommercial", - "symlink": true - }, - "SwagCmsExtensions": { - "type": "path", - "url": "custom/plugins/SwagCmsExtensions", - "symlink": true - } - } + install-commercial: true - name: Run ESLint env: STOREFRONT_PATH: ${{ github.workspace }}/src/Storefront/Resources/app/storefront