forked from SUPLA/supla-cloud
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
120 lines (106 loc) · 3.07 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
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-php7.4
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-php7.4
depends_on: [install-backend]
commands:
- composer run lint-backend
- name: backend-unit-tests
image: supla/supla-cloud:ci-php7.4
depends_on: [install-backend]
commands:
- ./vendor/bin/phpunit -c app --testsuite unit
- name: api-tests
image: supla/supla-cloud:ci-php7.4
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-php7.4
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 dialog php7.4 php7.4-curl php7.4-dom php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-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: 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: ~