-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
97 lines (88 loc) · 2.79 KB
/
.drone.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
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
kind: pipeline
type: docker
name: Unit & Build Test (lowest)
steps:
- name: test
image: ecmchow/php-redis:7.4-cli
environment:
MMDB_FILEID:
from_secret: MMDB_FILEID
commands:
- bash
- service redis-server restart
- wget -O mmdb/GeoLite2-City.mmdb "https://drive.google.com/uc?export=download&confirm=yes&id=$${MMDB_FILEID}"
- chmod -R +x tools
- composer install
- tools/php-cs-fixer-v3.phar fix Core --using-cache=no --diff --dry-run --verbose
- tools/php-cs-fixer-v3.phar fix start-analyzer.php --using-cache=no --diff --dry-run --verbose
- php tools/phpunit-9.5.phar --testsuite core-units
- openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout test/selfsigned.key -out test/selfsigned.crt
- composer run ci-e2e && sleep 0.1
- cat test/e2e.log
- cat test/e2e-redis.log
- composer run build
- chmod +x dist/ip-analyzer.phar
- composer run ci-build && sleep 0.1
- cat test/build.log
- cat test/build-redis.log
trigger:
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: Unit & Build Test (latest)
steps:
- name: test
image: ecmchow/php-redis:8.1-cli
environment:
MMDB_FILEID:
from_secret: MMDB_FILEID
commands:
- bash
- service redis-server restart
- wget -O mmdb/GeoLite2-City.mmdb "https://drive.google.com/uc?export=download&confirm=yes&id=$${MMDB_FILEID}"
- chmod -R +x tools
- composer install
- tools/php-cs-fixer-v3.phar fix Core --using-cache=no --diff --dry-run --verbose
- tools/php-cs-fixer-v3.phar fix start-analyzer.php --using-cache=no --diff --dry-run --verbose
- php tools/phpunit-9.5.phar --testsuite core-units
- openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout test/selfsigned.key -out test/selfsigned.crt
- composer run ci-e2e && sleep 0.1
- cat test/e2e.log
- cat test/e2e-redis.log
- composer run build
- chmod +x dist/ip-analyzer.phar
- composer run ci-build && sleep 0.1
- cat test/build.log
- cat test/build-redis.log
trigger:
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: CI
steps:
- name: notify
image: plugins/slack
settings:
webhook:
from_secret: SLACK_WEBHOOK
template: "*{{#success build.status}}:white_check_mark:{{ else }}:x:{{/success}} {{ uppercasefirst build.event }} {{ uppercase build.status }}* \nProject: `{{ repo.owner }}/{{ repo.name }}` ({{ build.branch }})\nBuild #{{ build.number }} ({{ truncate build.commit 8 }}) by {{ build.author }} \n<{{ build.link }}|Drone CI>"
when:
status:
- success
- failure
depends_on:
- Unit & Build Test (lowest)
- Unit & Build Test (latest)
trigger:
event:
- push
- pull_request
status: # always run
- success
- failure