Skip to content

Commit

Permalink
PO-489 - add setup-paypal
Browse files Browse the repository at this point in the history
  • Loading branch information
mkraeml committed Nov 26, 2024
1 parent 1bf909f commit b240ed9
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 178 deletions.
97 changes: 97 additions & 0 deletions .github/actions/setup-paypal/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
46 changes: 7 additions & 39 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 9 additions & 57 deletions .github/workflows/intergration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
54 changes: 11 additions & 43 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- trunk
pull_request:
# TODO: paths: src/**/*.php & composer.json ...
# paths:
# - composer.json
workflow_dispatch:
workflow_call:

Expand All @@ -18,59 +20,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
PLATFORM_BRANCH: ["6.6.0.0", "trunk"]
PLATFORM_BRANCH: ["v6.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: |
composer dump-autoload --dev -d "${GITHUB_WORKSPACE}/custom/plugins/SwagCmsExtensions"
composer dump-autoload --dev -d "${GITHUB_WORKSPACE}/custom/plugins/SwagCommercial"
sed -i 's|reportUnmatchedIgnoredErrors: true|reportUnmatchedIgnoredErrors: false|' ./phpstan.neon.dist
if [[ "${{ matrix.PLATFORM_BRANCH }}" == "6.6.0.0" ]]; then
if [[ "${{ matrix.PLATFORM_BRANCH }}" == "v6.6.0.0" ]]; then
sed -i '/type_perfect/d' ./phpstan.neon.dist
sed -i '/narrow_return: true/d' ./phpstan.neon.dist
sed -i '/no_mixed: true/d' ./phpstan.neon.dist
Expand Down
45 changes: 6 additions & 39 deletions .github/workflows/storefront.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b240ed9

Please sign in to comment.