Skip to content

Commit

Permalink
Merge branch 'next-00000/use-currents' into 'trunk'
Browse files Browse the repository at this point in the history
NEXT-37263 - Add github actions

See merge request shopware/6/services/migration-assistant!552
  • Loading branch information
jozsefdamokos committed Jan 21, 2025
2 parents 984584f + 86b819c commit 897e5a8
Show file tree
Hide file tree
Showing 12 changed files with 1,956 additions and 171 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Admin

on:
workflow_dispatch:
push:
branches:
- trunk
pull_request:
paths:
- src/Resources/app/administration
- tests/Jest
workflow_call:

jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: shopware/github-actions/eslint@main
with:
extensionName: ${{ github.event.repository.name }}
projectPath: tests/Jest

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
137 changes: 137 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Integration

on:
workflow_dispatch:
push:
branches:
- trunk
pull_request:

jobs:
danger:
runs-on: ubuntu-latest
if: ${{ !github.event.act }}
steps:
- name: Clone
uses: actions/checkout@v1

- name: Danger
uses: shyim/[email protected]
env:
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: ["v6.6.1.0", "trunk"]
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: Clone TestData
working-directory: custom/plugins/${{ github.event.repository.name }}/tests
run: mysql -uroot < testData/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: ["v6.6.1.0", "trunk"]
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 }}
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 < testData/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
61 changes: 61 additions & 0 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: PHP Checks

on:
workflow_dispatch:
push:
branches:
- trunk
pull_request:
paths:
- composer.json
- src/**/*.php
- tests/**/*.php

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://[email protected]/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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @internal
*/
#[Package('core')]
#[Package('fundamentals@after-sales')]
class Migration1715162778AddAutoIncrementToLogging extends MigrationStep
{
public function getCreationTimestamp(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @internal
*/
#[Package('core')]
#[Package('fundamentals@after-sales')]
class Migration1716896739RemovePremappingFromRun extends MigrationStep
{
public function getCreationTimestamp(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @internal
*/
#[Package('core')]
#[Package('fundamentals@after-sales')]
class Migration1717400987UpdateStatusToStepColumnForRun extends MigrationStep
{
public function getCreationTimestamp(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @internal
*/
#[Package('core')]
#[Package('fundamentals@after-sales')]
class Migration1718174274RemoveUserAndAccessTokenFromRun extends MigrationStep
{
public function getCreationTimestamp(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @internal
*/
#[Package('core')]
#[Package('fundamentals@after-sales')]
class Migration1720008983TruncateOutdatedProgressStructureFromRun extends MigrationStep
{
public function getCreationTimestamp(): int
Expand Down
Loading

0 comments on commit 897e5a8

Please sign in to comment.