-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
51 lines (49 loc) · 2.24 KB
/
bitbucket-pipelines.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
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.3.24
definitions:
services:
docker:
memory: 2048
steps:
- step:
name: Deploy Staging
caches:
- composer
artifacts:
- vendor/**
script:
- php -v
- step: &wp-code-checking
name: WordPress Code Check
caches:
- composer
artifacts:
- vendor/**
script:
- apt-get update && apt-get install -y git unzip libfreetype6-dev libjpeg-dev libpng-dev libzip-dev libonig-dev libicu-dev libsodium-dev
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
- docker-php-ext-configure intl
- docker-php-ext-install -j$(nproc) gd intl
- docker-php-ext-install bcmath zip sodium
- echo 'memory_limit = 2G' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini
#- rm -rf ./composer.json
- composer require phpmd/phpmd
- composer require squizlabs/php_codesniffer
- composer global require "wp-coding-standards/wpcs"
- php vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-standards/wpcs
- php vendor/bin/phpcs --standard=WordPress-Core --report=code --ignore=woocommerce,vendor,.github,assets --runtime-set ignore_warnings_on_exit true ./
- php vendor/bin/phpmd ./ text cleancode,codesize,controversial,design,naming,unusedcode --exclude vendor/
- php -v
# Currently we run it for all branches and pull requests.
# Later we would split it up by "branches", where we would have image and script for "master" and same for "develop" and "feature/*" branches.
pipelines:
default:
- step: *wp-code-checking
pull-requests:
'develop/*':
- step: *wp-code-checking