-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy path.drone.yml
135 lines (120 loc) · 3.65 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
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
kind: pipeline
name: default
steps:
- name: install-frontend
image: node:16.20.2-slim
depends_on: [clone]
commands:
- npm -v
- node -v
- cd src/frontend
- npm ci
- name: build-frontend
image: node:16.20.2-slim
depends_on: [install-frontend]
commands:
- cd src/frontend && npm run build
- name: lint-frontend
image: node:16.20.2-slim
depends_on: [install-frontend]
commands:
- cd src/frontend && npm run lint -s
# - name: audit-frontend
# image: node:16.20.2-slim
# depends_on: [install-frontend]
# commands:
# - cd src/frontend && npm audit --production
- name: test-frontend-unit
image: node:16.20.2-slim
depends_on: [build-frontend]
commands:
- cd src/frontend
- npm run test:unit
- name: install-backend
image: supla/supla-cloud:ci-php8.3
pull: always
depends_on: [clone]
commands:
- cp app/config/parameters.yml.drone app/config/parameters.yml
- composer install --optimize-autoloader
- name: lint-backend
image: supla/supla-cloud:ci-php8.3
depends_on: [install-backend]
commands:
- composer run lint-backend
- name: backend-unit-tests
image: supla/supla-cloud:ci-php8.3
depends_on: [install-backend]
commands:
- ./vendor/bin/phpunit -c app --testsuite unit
- name: api-tests
image: supla/supla-cloud:ci-php8.3
depends_on: [install-backend, build-frontend]
commands:
- rm -fr var/cache/test
- ./vendor/bin/phpunit -c app --stop-on-error --stop-on-failure --testsuite api
- name: integration-tests
image: supla/supla-cloud:ci-php8.3
depends_on: [api-tests]
commands:
- rm -fr var/cache/test
- ./vendor/bin/phpunit -c app --stop-on-error --stop-on-failure --testsuite integration
- name: test-e2e
image: cypress/base:16.18.1
depends_on: [install-backend, build-frontend]
environment:
CYPRESS_DATABASE: mysql://root@database/supla_e2e
commands:
- apt-get update && apt-get install -y ca-certificates apt-transport-https software-properties-common wget gnupg
- echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list
- wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -
- apt-get update && apt-get install -y dialog php8.3 php8.3-curl php8.3-dom php8.3-intl php8.3-mbstring php8.3-mysql php8.3-zip
- cd src/frontend
- npm ci
- node_modules/cypress/bin/cypress install
- npm run test:e2e:ci
- name: test-e2e-nightly
image: cypress/base:16.18.1
depends_on: [test-e2e]
when:
cron: nightly
event: cron
commands:
- cd src/frontend
- npm ci
- node_modules/cypress/bin/cypress install
- npm run test:e2e:nightly
- name: dump-logs
image: cypress/base:16.18.1
depends_on: [api-tests, test-e2e]
failure: ignore
when:
status: [success, failure]
trigger:
status: [success, failure]
commands:
- ls var/logs
- find var/logs/ -type f | xargs cat
- name: notify
image: mike1pol/drone-rocket
depends_on: [integration-tests, test-e2e]
failure: ignore
settings:
url: {from_secret: rocket_url}
user_id: {from_secret: rocket_user}
token: {from_secret: rocket_token}
channel: github
when:
status: [success, failure]
trigger:
status: [success, failure]
event:
exclude: [pull_request]
services:
- name: database
image: mysql:5.7.20
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: supla_test
MYSQL_USER: drone
MYSQL_PASSWORD: ~