-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.drone.jsonnet
137 lines (132 loc) · 4.05 KB
/
.drone.jsonnet
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
local volumes = [
{
name: "composer-cache",
path: "/tmp/composer-cache",
},
];
local hostvolumes = [
{
name: "composer-cache",
host: {path: "/tmp/composer-cache"}
},
];
local composer(phpversion, params) = {
name: "composer",
image: "joomlaprojects/docker-images:php" + phpversion,
volumes: volumes,
commands: [
"php -v",
"composer update " + params,
]
};
local phpunit(phpversion) = {
name: "PHPUnit",
image: "joomlaprojects/docker-images:php" + phpversion,
[if phpversion == "8.0" then "failure"]: "ignore",
commands: ["vendor/bin/phpunit"]
};
local pipeline(name, phpversion, params) = {
kind: "pipeline",
name: "PHP " + name,
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit(phpversion)
],
};
[
{
kind: "pipeline",
name: "Codequality",
volumes: hostvolumes,
steps: [
{
name: "composer",
image: "joomlaprojects/docker-images:php7.4",
volumes: volumes,
commands: [
"php -v",
"composer update",
"composer require phpmd/phpmd phpstan/phpstan"
]
},
{
name: "phpcs",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
commands: [
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
"vendor/bin/phpcs -p --report=full --extensions=php --standard=Joomla src/"
]
},
{
name: "phpmd",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"vendor/bin/phpmd src text cleancode",
"vendor/bin/phpmd src text codesize",
"vendor/bin/phpmd src text controversial",
"vendor/bin/phpmd src text design",
"vendor/bin/phpmd src text unusedcode",
]
},
{
name: "phpstan",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"vendor/bin/phpstan analyse src",
]
},
{
name: "phploc",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"phploc src",
]
},
{
name: "phpcpd",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"phpcpd src",
]
}
]
},
{
kind: "pipeline",
name: "PHP 5.3 lowest",
volumes: hostvolumes,
steps: [
{
name: "composer",
image: "joomlaprojects/docker-images:php5.3",
volumes: volumes,
commands: [
"php -v",
"composer update --prefer-stable --prefer-lowest",
"composer update phpunit/phpunit-mock-objects"
]
},
phpunit("5.3")
]
},
pipeline("5.3", "5.3", "--prefer-stable"),
pipeline("5.4", "5.4", "--prefer-stable"),
pipeline("5.5", "5.5", "--prefer-stable"),
pipeline("5.6", "5.6", "--prefer-stable"),
pipeline("7.0", "7.0", "--prefer-stable"),
pipeline("7.1", "7.1", "--prefer-stable"),
pipeline("7.2", "7.2", "--prefer-stable"),
pipeline("7.3", "7.3", "--prefer-stable"),
pipeline("7.4", "7.4", "--prefer-stable"),
pipeline("8.0", "8.0", "--ignore-platform-reqs --prefer-stable")
]