-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
59 lines (54 loc) · 2.15 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
52
53
54
55
56
57
58
59
image: php:8.3.0
definitions:
steps:
- step: &prequisites
name: Install composer and prequisite packages
runs-on: self.hosted
caches:
- composer
artifacts:
- .env
- vendor/**
script:
- apt-get -qq update && apt-get -y install git zip libzip-dev
- docker-php-ext-install zip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install --no-progress
- echo $ENV | base64 --decode --ignore-garbage > .env
- parallel:
- step: &security-check
name: Run security checks
runs-on: self.hosted
script:
- apt-get -qq update && apt-get -y install git
- curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.6/local-php-security-checker_2.0.6_linux_amd64 --output /usr/local/bin/local-php-security-checker
- chmod 755 /usr/local/bin/local-php-security-checker
- vendor/bin/grumphp run --testsuite=security
- step: &syntax-check
name: Run syntax and style checks
runs-on: self.hosted
script:
- apt-get -qq update && apt-get -y install git
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- vendor/bin/grumphp run --testsuite=syntax
- vendor/bin/pint --test
- step: &static-analysis
name: Run static analysis
runs-on: self.hosted
script:
- apt-get -qq update && apt-get -y install git
- echo "memory_limit = 1024M" > $PHP_INI_DIR/conf.d/php-memory-limits.ini
- vendor/bin/grumphp run --testsuite=static
- step: &unit-tests
name: Run unit tests
runs-on: self.hosted
script:
- apt-get -qq update && apt-get -y install git
- vendor/bin/phpunit --log-junit ./test-reports/junit.xml
pipelines:
default:
- step: *prequisites
- step: *security-check
- step: *syntax-check
- step: *static-analysis
- step: *unit-tests