-
Notifications
You must be signed in to change notification settings - Fork 1
/
buddy.yml
199 lines (199 loc) · 7.05 KB
/
buddy.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
- pipeline: "Pull Request Tests"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "refs/pull/*"
ref_type: "WILDCARD"
priority: "NORMAL"
target_site_url: "https://github.com/alleyinteractive/fm-gutenberg"
fetch_all_refs: true
fail_on_prepare_env_warning: true
trigger_condition: "ALWAYS"
actions:
- action: "Gitignored files check"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "alleyops/ci-resources"
docker_image_tag: "7.4-fpm-wp"
execute_commands:
- "if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
run_next_parallel: true
- action: "Check for git conflicts"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "alleyops/ci-resources"
docker_image_tag: "7.4-fpm-wp"
execute_commands:
- "! git grep -E '<<<<<<< HEAD|=======.*>>>>>>>' \":!$0\""
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "Composer install"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "alleyops/ci-resources"
docker_image_tag: "7.4-fpm-wp"
execute_commands:
- "composer install -q"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "Prepare WordPress test environment"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "alleyops/ci-resources"
docker_image_tag: "7.4-fpm-wp"
execute_commands:
- "# Clear out any previously cached testing folders."
- "rm -rf .buddy-tests; mkdir -p .buddy-tests"
- "rm -f object-cache.php"
- ""
- "# Install tests"
- "# Set up the WordPress installation, skipping database creation"
- "bash <(curl -s \"https://raw.githubusercontent.com/wp-cli/sample-plugin/master/bin/install-wp-tests.sh\") wordpress_test root root mysql latest true"
- ""
- "# Wire up object-cache and inform WordPress config about the server location"
- "echo 'global $memcached_servers;' >> ${WP_TESTS_DIR}/wp-tests-config.php # Notably requires setting it globally"
- "echo '$memcached_servers = array(\"memcached:11211\");' >> ${WP_TESTS_DIR}/wp-tests-config.php # See https://github.com/Automattic/wp-memcached/blob/master/readme.txt"
- ""
- "# Rsync wp-content to ${WP_CORE_DIR} for testing"
- "rm -rf \"${WP_CORE_DIR}/wp-content/plugins\""
- "mkdir -p \"${WP_CORE_DIR}/wp-content/plugins/fm-gutenberg\""
- "rsync -a \\"
- "\t--exclude=.git \\"
- "\t--exclude=.npm \\"
- "\t--exclude=.buddy-tests \\"
- "\t--exclude=node_modules \\"
- "\t. \"${WP_CORE_DIR}/wp-content/plugins/fm-gutenberg\""
- ""
- "# Wire up object cache."
- "curl -s https://raw.githubusercontent.com/Automattic/wp-memcached/master/object-cache.php > ${WP_CONTENT_DIR}/object-cache.php"
- ""
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "phpunit"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "alleyops/ci-resources"
docker_image_tag: "7.4-fpm-wp"
execute_commands:
- "# Install database tables."
- "[[ $WP_MULTISITE -eq 1 ]] && WP_MULTISITE_STRING=\"run_ms_tests\" || WP_MULTISITE_STRING=\"no_ms_tests\""
- "php ${WP_TESTS_DIR}/includes/install.php ${WP_TESTS_DIR}/wp-tests-config.php $WP_MULTISITE_STRING"
- ""
- "cd ${WP_CORE_DIR}/wp-content/plugins/fm-gutenberg"
- "WP_TESTS_SKIP_INSTALL=1 composer phpunit"
setup_commands:
- "echo \"extension=memcache.so\" >> /usr/local/etc/php/conf.d/buddy.ini"
services:
- type: "MYSQL"
version: "5.7"
connection:
host: "mysql"
port: 3306
user: "root"
password: "root"
db: "wordpress_test"
- type: "MEMCACHED"
version: "1.5.6"
connection:
host: "memcached"
port: 11211
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
run_next_parallel: true
- action: "composer phpcs"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "alleyops/ci-resources"
docker_image_tag: "7.4-fpm-wp"
execute_commands:
- "composer phpcs"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "npm audit"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "library/node"
docker_image_tag: "16"
execute_commands:
- "npm audit --audit-level=high --production --cache /buddy/fm-gutenberg/.npm"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "npm ci"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "library/node"
docker_image_tag: "16"
execute_commands:
- "npm ci --cache /buddy/fm-gutenberg/.npm"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "npm run lint"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "library/node"
docker_image_tag: "16"
execute_commands:
- "npm run lint"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
run_next_parallel: true
- action: "npm run stylelint"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "library/node"
docker_image_tag: "16"
execute_commands:
- "npm run stylelint"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "npm run test"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "library/node"
docker_image_tag: "16"
execute_commands:
- "npm run test"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "npm run build"
type: "BUILD"
working_directory: "/buddy/fm-gutenberg"
docker_image_name: "library/node"
docker_image_tag: "16"
execute_commands:
- "npm run build"
volume_mappings:
- "/:/buddy/fm-gutenberg"
trigger_condition: "ALWAYS"
shell: "BASH"
variables:
- key: "COMPOSER_HOME"
value: "/buddy/fm-gutenberg/.composer"
- key: "WP_CORE_DIR"
value: "/buddy/fm-gutenberg/.buddy-tests/wordpress"
- key: "WP_MULTISITE"
value: "0"
- key: "WP_TESTS_DIR"
value: "/buddy/fm-gutenberg/.buddy-tests/wordpress-tests-lib"