-
Notifications
You must be signed in to change notification settings - Fork 27
137 lines (130 loc) · 4.66 KB
/
integration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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/danger-php@0.3.4
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:root@127.0.0.1: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 --reporter=${{ github.event.act && 'line' || 'github' }} --trace=on-first-retry
- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-${{ github.event.repository.name }}-${{ github.sha }}
path:
custom/plugins/${{ github.event.repository.name }}/tests/acceptance/test-results/
custom/plugins/${{ github.event.repository.name }}/tests/acceptance/playwright-report/
retention-days: 3