-
-
Notifications
You must be signed in to change notification settings - Fork 10
215 lines (172 loc) · 7.22 KB
/
ci_pipe.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: CI Pipeline
on: [push]
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Install Dependencies
run: make dev -B
- name: Run ESLint
run: make eslint -B
# ------------------------------------------------------------------------------------------------------------------------
php_checks:
name: PHP Syntax Checks
runs-on: ubuntu-latest
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: PHP Syntax Checks
run: make phpcheck -B
phpunit:
name: Unit Tests | PHP ${{ matrix.php }}
needs: php_checks
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2' ]
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
run: make dev -B
- name: Run PHPUnit
run: make phpunit -B
infection:
name: Mutation Tests | PHP ${{ matrix.php }}
needs: phpunit
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2' ]
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
run: make dev -B
- name: Run Infection
run: make infection -B
phpcsfixer:
name: PHP CS Fixer
needs: infection
runs-on: ubuntu-latest
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Install Dependencies
run: make dev -B
- name: Run PHP CS Fixer
run: make csfix -B
# ------------------------------------------------------------------------------------------------------------------------
integration:
name: Integration Tests | Shopware ${{ matrix.shopware }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shopware: [ '6.6.0.0' ]
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Install PROD Dependencies
run: make install -B
- name: Start Docker
run: |
docker run --rm --name shop -d dockware/dev:${{ matrix.shopware }}
sleep 30
docker logs shop
- name: Upload into Docker
run: |
docker cp $(pwd)/. shop:/var/www/html/custom/plugins/WerklOpenBlogware
docker exec shop bash -c 'sudo chown www-data:www-data /var/www/html/custom/plugins -R'
- name: Install and Build Plugin
run: |
docker exec shop bash -c 'cd /var/www/html/custom/plugins/WerklOpenBlogware && make clean'
docker exec shop bash -c 'cd /var/www/html/custom/plugins/WerklOpenBlogware && make install'
docker exec shop bash -c 'cd /var/www/html/custom/plugins/WerklOpenBlogware && make build'
# ------------------------------------------------------------------------------------------------------------------------
# e2e:
# name: E2E Tests | Shopware ${{ matrix.shopware }}, PHP ${{ matrix.php }}
# needs: integration
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# include:
# - shopware: '6.6.0.0'
# php: '8.2'
# steps:
# - name: Clone Code
# uses: actions/checkout@v4
# - name: Download Docker
# run: |
# docker pull dockware/dev:${{ matrix.shopware }}
# - name: Start Docker
# run: |
# docker run --rm -p 443:443 --name shop --env PHP_VERSION=${{ matrix.php }} --env SHOP_DOMAIN=www.blog.local -d dockware/dev:${{ matrix.shopware }}
# sleep 30
# docker logs shop
# # now change the domain of our shop, blog doesn't work with localhost
# sudo echo "127.0.0.1 www.blog.local" | sudo tee -a /etc/hosts
# - name: Upload into Docker
# run: |
# docker cp $(pwd)/. shop:/var/www/html/custom/plugins/WerklOpenBlogware
# docker exec shop bash -c 'sudo chown www-data:www-data /var/www/html/custom/plugins -R'
# - name: Install and Build Artifacts
# run: |
# docker exec shop bash -c 'cd /var/www/html/custom/plugins/WerklOpenBlogware && make install -B'
# docker exec shop bash -c 'cd /var/www/html/custom/plugins/WerklOpenBlogware && make build -B'
# - name: Install/Configure Plugin
# run: |
# docker exec shop bash -c 'php bin/console plugin:refresh'
# docker exec shop bash -c 'php bin/console plugin:install WerklOpenBlogware --activate'
# docker exec shop bash -c 'php bin/console cache:clear'
# - name: Install Cypress
# run: cd tests/Cypress && make install -B
# - name: Prepare Cypress
# run: cd tests/Cypress && cp cypress.config.example.js cypress.config.js
# - name: Start Cypress
# run: cd tests/Cypress && make run shopware=${{ matrix.shopware }} url=https://www.blog.local
# - name: Download Logs
# if: ${{ always() }}
# run: |
# mkdir -p $(pwd)/tests/Cypress/cypress/logs/shopware
# mkdir -p $(pwd)/tests/Cypress/cypress/logs/apache
# docker cp shop:/var/www/html/var/log/. $(pwd)/tests/Cypress/cypress/logs/shopware
# docker cp shop:/var/log/php/. $(pwd)/tests/Cypress/cypress/logs/apache
# - name: Store Cypress Results
# if: ${{ always() }}
# uses: actions/upload-artifact@v2
# with:
# name: cypress_results_sw_v${{ matrix.shopware }}
# retention-days: 1
# path: |
# tests/Cypress/cypress/logs
# tests/Cypress/cypress/videos
# tests/Cypress/cypress/screenshots