-
Notifications
You must be signed in to change notification settings - Fork 110
321 lines (311 loc) · 13.6 KB
/
movabletype.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
name: movabletype/movabletype
on:
push:
branches:
- "**/*"
pull_request:
schedule:
- cron: '30 0 * * *'
concurrency:
# # This item has no matching transformer
# maximum_number_of_builds: 0
group: "${{ github.ref }}"
cancel-in-progress: true
env:
MT_TEST_IGNORE_FIXTURE: '0'
DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
jobs:
# Perl 5.38 / PHP 8.2 / MySQL 8.0
fedora39:
env:
TEST_IMAGE_NAME: fedora39
if: ${{ ( (github.event_name != 'schedule') || ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) ) }}
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- selenium
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ (matrix.test != 'php' && matrix.test != 'selenium') }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test selenium
if: ${{ matrix.test == 'selenium' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:chromiumdriver bash -c "MT_TEST_SELENIUM_MAX_RETRY=5 prove -lr -j1 -PMySQLPool=MT::Test::Env -It/lib t/selenium"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit && make test-php-lint"
# Perl 5.38 / PHP 8.3 / MySQL 8.0
fedora40:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
env:
TEST_IMAGE_NAME: fedora40
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ matrix.test != 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit && make test-php-lint"
# Perl 5.34 / PHP 8.0 / MySQL 8.0
fedora35:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
env:
TEST_IMAGE_NAME: fedora35
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ matrix.test != 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "MT_TEST_RUN_APP_AS_CGI=1 prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit php/tests/*Test.php && make test-php-lint"
# Perl 5.36 / PHP 8.1 / MySQL 8.0
fedora37:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
env:
TEST_IMAGE_NAME: fedora37
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ matrix.test != 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "MT_TEST_BUILDER=MT::Builder::Fast prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit && make test-php-lint"
# Perl 5.10 / PHP 5.5 / MySQL 5.1
centos6:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
env:
TEST_IMAGE_NAME: centos6
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "MT_TEST_DISABLE_OBJECT_CACHE=1 prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
# Perl 5.32 / PHP 7.4 / MariaDB 10.5
bullseye:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
env:
TEST_IMAGE_NAME: bullseye
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ matrix.test != 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "MT_TEST_ADMIN_THEME_ID=0 prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit && make test-php-lint"
# Perl 5.28.0 / PHP 7.3 / MariaDB 10.3
buster:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
env:
TEST_IMAGE_NAME: buster
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ matrix.test != 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "MT_TEST_FORCE_DATAAPI_VERSION=5 prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit && make test-php-lint"
cloud7:
needs: [fedora39]
env:
TEST_IMAGE_NAME: cloud7
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "t/*.t"
- "t/mt7/[^t]*"
- "t/mt7/t*"
- "t/admin_theme_id/ t/app/ t/class/ t/cms/ t/model/ t/mt_object/ t/object_driver/ t/task/ t/template/ t/tools t/util/"
- "t/cms_permission/"
- "t/data_api/"
- "t/tag/"
- "plugins/*/t"
- php
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test
if: ${{ matrix.test != 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "prove -lr -j4 -PMySQLPool=MT::Test::Env -It/lib ${{ matrix.test }}"
- name: test php
if: ${{ matrix.test == 'php' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:$TEST_IMAGE_NAME bash -c "phpunit && make test-php-lint"
extra:
needs: [fedora39]
if: ${{ ( ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) || contains(github.head_ref, 'cron') ) }}
runs-on: ubuntu-latest
strategy:
matrix:
test:
- selenium
- xt
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- name: login
run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- name: test selenium
if: ${{ matrix.test == 'selenium' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:chromiumdriver bash -c "BUILD_RELEASE_NUMBER=1 make && MT_TEST_SELENIUM_MAX_RETRY=5 MT_TEST_CRAWL=1 prove -j1 -PMySQLPool=MT::Test::Env -It/lib t/selenium/crawl.t"
- name: test xt
if: ${{ matrix.test == 'xt' }}
run: docker run -t -v $PWD:/mt -w /mt movabletype/test:buster bash -c "prove -j4 -PMySQLPool=MT::Test::Env -It/lib xt"
notify_slack:
runs-on: ubuntu-latest
needs:
- fedora39
- fedora40
- fedora35
- fedora37
- centos6
- bullseye
- buster
- cloud7
- extra
if: ${{ ( (github.event_name != 'schedule') || ( (github.repository == 'movabletype/movabletype' ) && (github.event_name == 'schedule') && ((github.ref == 'refs/heads/master') || contains(github.ref, '/develop') || contains(github.ref, '/support-') || contains(github.ref, '/release-')) ) ) }}
steps:
- name: Install jq
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Filters if the "needs" context has "failure"
run: |
HAS_FAILURE=$(echo '${{ toJSON(needs) }}' | jq '[.[] | select(.result == "failure") | .result] | join(",")' | sed -e 's/"//g')
echo "HAS_FAILURE=${HAS_FAILURE}" >> "$GITHUB_ENV"
- name: SLACK_COLOR is danger
if: ${{ env.HAS_FAILURE }}
run: |
echo "SLACK_COLOR=danger" >> "$GITHUB_ENV"
- name: SLACK_COLOR is good
if: ${{ ! env.HAS_FAILURE }}
run: |
echo "SLACK_COLOR=good" >> "$GITHUB_ENV"
- uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK }}"
SLACK_USERNAME: "GitHub Actions ${{ github.repository }}"
SLACK_TITLE: 'Workflow #${{ github.run_number }}'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_COLOR: "${{ env.SLACK_COLOR }}"