|
1 | 1 | pipelines: |
2 | 2 | default: |
3 | 3 | - step: |
4 | | - image: php:5.6 |
5 | | - name: "PHP 5.6" |
| 4 | + image: php:7.4 |
| 5 | + name: "PHP 7.4" |
6 | 6 | script: |
7 | 7 | # 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 |
10 | 9 |
|
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 |
14 | 12 |
|
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 |
20 | 15 |
|
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 |
23 | 22 |
|
24 | 23 | # Install PHPUnit |
25 | | - - PHPUNIT_VERSION=5.7.27 |
| 24 | + - PHPUNIT_VERSION=9.6.19 |
26 | 25 | - 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" |
27 | 28 | - phpunit --version |
28 | 29 |
|
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" |
45 | 34 | - phpcs --version |
46 | 35 |
|
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 |
54 | 37 | - phpcs |
55 | 38 |
|
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 |
63 | 40 | - phpunit |
64 | 41 | services: |
65 | 42 | - database |
66 | 43 |
|
67 | 44 | - step: |
68 | | - image: php:7.1 |
69 | | - name: "PHP 7.1" |
| 45 | + image: php:8.0 |
| 46 | + name: "PHP 8.0" |
70 | 47 | script: |
71 | 48 | # 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 |
74 | 50 |
|
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 |
78 | 53 |
|
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 |
84 | 56 |
|
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 |
87 | 63 |
|
88 | 64 | # Install PHPUnit |
89 | | - - PHPUNIT_VERSION=6.5.6 |
| 65 | + - PHPUNIT_VERSION=9.6.19 |
90 | 66 | - 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" |
91 | 69 | - phpunit --version |
92 | 70 |
|
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 |
95 | 81 | - phpunit |
96 | 82 | services: |
97 | 83 | - database |
98 | 84 |
|
99 | 85 | - step: |
100 | | - image: php:7.2 |
101 | | - name: "PHP 7.2" |
| 86 | + image: php:8.2 |
| 87 | + name: "PHP 8.2" |
102 | 88 | script: |
103 | 89 | # 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 |
106 | 91 |
|
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 |
110 | 94 |
|
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 |
116 | 97 |
|
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 |
119 | 104 |
|
120 | 105 | # Install PHPUnit |
121 | | - - PHPUNIT_VERSION=6.5.6 |
| 106 | + - PHPUNIT_VERSION=9.6.19 |
122 | 107 | - 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" |
123 | 110 | - phpunit --version |
124 | 111 |
|
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 |
127 | 122 | - phpunit |
128 | 123 | services: |
129 | 124 | - database |
|
0 commit comments