refactor: unify public api #696
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/sw55.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 }} | |
| acceptance: | |
| 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 | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: shopware | |
| ports: | |
| - 3306:3306 | |
| env: | |
| DATABASE_URL: mysql://root:[email protected]: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: true | |
| 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/sw55.sql | |
| - name: Install playwright | |
| working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance | |
| run: | | |
| npm ci | |
| npx playwright install --with-deps | |
| # - name: Run Playwright with reporting | |
| # working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance | |
| # run: | | |
| # npx pwc --project-id ${{ secrets.CURRENTS_PROJECT_ID }} --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ matrix.PLATFORM_BRANCH }}-${{ github.run_attempt }} -- --trace=on | |
| - name: Run Playwright | |
| working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance | |
| run: npx playwright test --trace=on | |
| - 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 |