Skip to content

Commit a27c3a7

Browse files
authored
Merge pull request #339 from ernilambar/197-update-bitbucket-ci
2 parents 47cd9ce + 6052d62 commit a27c3a7

File tree

3 files changed

+92
-123
lines changed

3 files changed

+92
-123
lines changed

features/scaffold-plugin-tests.feature

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -172,42 +172,29 @@ Feature: Scaffold plugin unit tests
172172
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
173173
"""
174174
- step:
175-
image: php:5.6
176-
name: "PHP 5.6"
175+
image: php:7.4
176+
name: "PHP 7.4"
177177
script:
178178
# Install Dependencies
179-
- docker-php-ext-install mysqli
180-
- apt-get update && apt-get install -y subversion --no-install-recommends
179+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
181180
"""
182181
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
183182
"""
184183
- step:
185-
image: php:7.0
186-
name: "PHP 7.0"
184+
image: php:8.0
185+
name: "PHP 8.0"
187186
script:
188187
# Install Dependencies
189-
- docker-php-ext-install mysqli
190-
- apt-get update && apt-get install -y subversion --no-install-recommends
188+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
191189
"""
192190
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
193191
"""
194192
- step:
195-
image: php:7.1
196-
name: "PHP 7.1"
193+
image: php:8.2
194+
name: "PHP 8.2"
197195
script:
198196
# Install Dependencies
199-
- docker-php-ext-install mysqli
200-
- apt-get update && apt-get install -y subversion --no-install-recommends
201-
"""
202-
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
203-
"""
204-
- step:
205-
image: php:7.2
206-
name: "PHP 7.2"
207-
script:
208-
# Install Dependencies
209-
- docker-php-ext-install mysqli
210-
- apt-get update && apt-get install -y subversion --no-install-recommends
197+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
211198
"""
212199
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
213200
"""

features/scaffold-theme-tests.feature

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,42 +168,29 @@ Feature: Scaffold theme unit tests
168168
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
169169
"""
170170
- step:
171-
image: php:5.6
172-
name: "PHP 5.6"
171+
image: php:7.4
172+
name: "PHP 7.4"
173173
script:
174174
# Install Dependencies
175-
- docker-php-ext-install mysqli
176-
- apt-get update && apt-get install -y subversion --no-install-recommends
175+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
177176
"""
178177
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
179178
"""
180179
- step:
181-
image: php:7.0
182-
name: "PHP 7.0"
180+
image: php:8.0
181+
name: "PHP 8.0"
183182
script:
184183
# Install Dependencies
185-
- docker-php-ext-install mysqli
186-
- apt-get update && apt-get install -y subversion --no-install-recommends
184+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
187185
"""
188186
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
189187
"""
190188
- step:
191-
image: php:7.1
192-
name: "PHP 7.1"
189+
image: php:8.2
190+
name: "PHP 8.2"
193191
script:
194192
# Install Dependencies
195-
- docker-php-ext-install mysqli
196-
- apt-get update && apt-get install -y subversion --no-install-recommends
197-
"""
198-
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
199-
"""
200-
- step:
201-
image: php:7.2
202-
name: "PHP 7.2"
203-
script:
204-
# Install Dependencies
205-
- docker-php-ext-install mysqli
206-
- apt-get update && apt-get install -y subversion --no-install-recommends
193+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
207194
"""
208195
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
209196
"""

templates/plugin-bitbucket.mustache

Lines changed: 74 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,124 @@
11
pipelines:
22
default:
33
- step:
4-
image: php:5.6
5-
name: "PHP 5.6"
4+
image: php:7.4
5+
name: "PHP 7.4"
66
script:
77
# Install Dependencies
8-
- docker-php-ext-install mysqli
9-
- apt-get update && apt-get install -y subversion --no-install-recommends
8+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
109

11-
# Install PHPCS
12-
- curl -o /usr/local/bin/phpcs -fSL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar && chmod +x /usr/local/bin/phpcs
13-
- phpcs --version
10+
# PHP extensions
11+
- docker-php-ext-install -j$(nproc) mysqli pdo_mysql zip
1412

15-
# Install WordPress Coding Standards
16-
- WPCS_VERSION=0.14.1
17-
- curl -o wpcs.tar.gz -fSL "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/${WPCS_VERSION}.tar.gz"
18-
- mkdir -p /var/wpcs && tar -xzf wpcs.tar.gz --directory /var/wpcs --strip-components 1 && rm wpcs.tar.gz
19-
- phpcs --config-set show_progress 1 && phpcs --config-set colors 1 && phpcs --config-set installed_paths /var/wpcs
13+
# Setup WordPress tests
14+
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
2015

21-
## Run PHPCS
22-
- phpcs
16+
# Install Composer
17+
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
18+
- php composer-setup.php --install-dir=/usr/local/bin --filename=composer
19+
- php -r "unlink('composer-setup.php');"
20+
- export PATH="$PATH:$HOME/.composer/vendor/bin"
21+
- export COMPOSER_ALLOW_SUPERUSER=1
2322

2423
# Install PHPUnit
25-
- PHPUNIT_VERSION=5.7.27
24+
- PHPUNIT_VERSION=9.6.19
2625
- curl -o /usr/local/bin/phpunit "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" && chmod +x /usr/local/bin/phpunit
26+
- composer global require yoast/phpunit-polyfills
27+
- export WP_TESTS_PHPUNIT_POLYFILLS_PATH="$HOME/.composer/vendor/yoast/phpunit-polyfills"
2728
- phpunit --version
2829

29-
## Run PHPUnit
30-
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
31-
- phpunit
32-
services:
33-
- database
34-
35-
- step:
36-
image: php:7.0
37-
name: "PHP 7.0"
38-
script:
39-
# Install Dependencies
40-
- docker-php-ext-install mysqli
41-
- apt-get update && apt-get install -y subversion --no-install-recommends
42-
43-
# Install PHPCS
44-
- curl -o /usr/local/bin/phpcs -fSL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar && chmod +x /usr/local/bin/phpcs
30+
# Install PHPCS and WPCS
31+
- composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
32+
- composer global require "wp-coding-standards/wpcs"
33+
- composer global require "phpcompatibility/phpcompatibility-wp"
4534
- phpcs --version
4635

47-
# Install WordPress Coding Standards
48-
- WPCS_VERSION=0.14.1
49-
- curl -o wpcs.tar.gz -fSL "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/${WPCS_VERSION}.tar.gz"
50-
- mkdir -p /var/wpcs && tar -xzf wpcs.tar.gz --directory /var/wpcs --strip-components 1 && rm wpcs.tar.gz
51-
- phpcs --config-set show_progress 1 && phpcs --config-set colors 1 && phpcs --config-set installed_paths /var/wpcs
52-
53-
## Run PHPCS
36+
# Run PHPCS
5437
- phpcs
5538

56-
# Install PHPUnit
57-
- PHPUNIT_VERSION=6.5.6
58-
- curl -o /usr/local/bin/phpunit "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" && chmod +x /usr/local/bin/phpunit
59-
- phpunit --version
60-
61-
## Run PHPUnit
62-
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
39+
# Run PHPUnit
6340
- phpunit
6441
services:
6542
- database
6643

6744
- step:
68-
image: php:7.1
69-
name: "PHP 7.1"
45+
image: php:8.0
46+
name: "PHP 8.0"
7047
script:
7148
# Install Dependencies
72-
- docker-php-ext-install mysqli
73-
- apt-get update && apt-get install -y subversion --no-install-recommends
49+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
7450

75-
# Install PHPCS
76-
- curl -o /usr/local/bin/phpcs -fSL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar && chmod +x /usr/local/bin/phpcs
77-
- phpcs --version
51+
# PHP extensions
52+
- docker-php-ext-install -j$(nproc) mysqli pdo_mysql zip
7853

79-
# Install WordPress Coding Standards
80-
- WPCS_VERSION=0.14.1
81-
- curl -o wpcs.tar.gz -fSL "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/${WPCS_VERSION}.tar.gz"
82-
- mkdir -p /var/wpcs && tar -xzf wpcs.tar.gz --directory /var/wpcs --strip-components 1 && rm wpcs.tar.gz
83-
- phpcs --config-set show_progress 1 && phpcs --config-set colors 1 && phpcs --config-set installed_paths /var/wpcs
54+
# Setup WordPress tests
55+
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
8456

85-
## Run PHPCS
86-
- phpcs
57+
# Install Composer
58+
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
59+
- php composer-setup.php --install-dir=/usr/local/bin --filename=composer
60+
- php -r "unlink('composer-setup.php');"
61+
- export PATH="$PATH:$HOME/.composer/vendor/bin"
62+
- export COMPOSER_ALLOW_SUPERUSER=1
8763

8864
# Install PHPUnit
89-
- PHPUNIT_VERSION=6.5.6
65+
- PHPUNIT_VERSION=9.6.19
9066
- curl -o /usr/local/bin/phpunit "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" && chmod +x /usr/local/bin/phpunit
67+
- composer global require yoast/phpunit-polyfills
68+
- export WP_TESTS_PHPUNIT_POLYFILLS_PATH="$HOME/.composer/vendor/yoast/phpunit-polyfills"
9169
- phpunit --version
9270

93-
## Run PHPUnit
94-
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
71+
# Install PHPCS and WPCS
72+
- composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
73+
- composer global require "wp-coding-standards/wpcs"
74+
- composer global require "phpcompatibility/phpcompatibility-wp"
75+
- phpcs --version
76+
77+
# Run PHPCS
78+
- phpcs
79+
80+
# Run PHPUnit
9581
- phpunit
9682
services:
9783
- database
9884

9985
- step:
100-
image: php:7.2
101-
name: "PHP 7.2"
86+
image: php:8.2
87+
name: "PHP 8.2"
10288
script:
10389
# Install Dependencies
104-
- docker-php-ext-install mysqli
105-
- apt-get update && apt-get install -y subversion --no-install-recommends
90+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
10691

107-
# Install PHPCS
108-
- curl -o /usr/local/bin/phpcs -fSL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar && chmod +x /usr/local/bin/phpcs
109-
- phpcs --version
92+
# PHP extensions
93+
- docker-php-ext-install -j$(nproc) mysqli pdo_mysql zip
11094

111-
# Install WordPress Coding Standards
112-
- WPCS_VERSION=0.14.1
113-
- curl -o wpcs.tar.gz -fSL "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/${WPCS_VERSION}.tar.gz"
114-
- mkdir -p /var/wpcs && tar -xzf wpcs.tar.gz --directory /var/wpcs --strip-components 1 && rm wpcs.tar.gz
115-
- phpcs --config-set show_progress 1 && phpcs --config-set colors 1 && phpcs --config-set installed_paths /var/wpcs
95+
# Setup WordPress tests
96+
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
11697

117-
## Run PHPCS
118-
- phpcs
98+
# Install Composer
99+
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
100+
- php composer-setup.php --install-dir=/usr/local/bin --filename=composer
101+
- php -r "unlink('composer-setup.php');"
102+
- export PATH="$PATH:$HOME/.composer/vendor/bin"
103+
- export COMPOSER_ALLOW_SUPERUSER=1
119104

120105
# Install PHPUnit
121-
- PHPUNIT_VERSION=6.5.6
106+
- PHPUNIT_VERSION=9.6.19
122107
- curl -o /usr/local/bin/phpunit "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" && chmod +x /usr/local/bin/phpunit
108+
- composer global require yoast/phpunit-polyfills
109+
- export WP_TESTS_PHPUNIT_POLYFILLS_PATH="$HOME/.composer/vendor/yoast/phpunit-polyfills"
123110
- phpunit --version
124111

125-
## Run PHPUnit
126-
- bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
112+
# Install PHPCS and WPCS
113+
- composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
114+
- composer global require "wp-coding-standards/wpcs"
115+
- composer global require "phpcompatibility/phpcompatibility-wp"
116+
- phpcs --version
117+
118+
# Run PHPCS
119+
- phpcs
120+
121+
# Run PHPUnit
127122
- phpunit
128123
services:
129124
- database

0 commit comments

Comments
 (0)