-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathconfig.yml
210 lines (195 loc) · 5.82 KB
/
config.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
version: 2.1
commands:
save_deps_cache:
steps:
- save_cache:
key: v1-mix-deps-cache-{{ checksum "mix.lock" }}
paths: ["deps"]
restore_deps_cache:
steps:
- restore_cache:
keys:
- v1-mix-deps-cache-{{ checksum "mix.lock" }}
save_build_cache:
parameters:
env:
description: Mix environment
type: string
default: dev
steps:
- save_cache:
key: v3-build-cache-{{ arch }}-<< parameters.env >>-{{ checksum "mix.lock" }}
paths: ["_build/<< parameters.env >>"]
restore_build_cache:
parameters:
env:
description: Mix environment
type: string
default: dev
steps:
- restore_cache:
keys:
- v3-build-cache-{{ arch }}-<< parameters.env >>-{{ checksum "mix.lock" }}
gen_version_file:
steps:
- run: asdf current erlang > .runtime_version
- run: asdf current elixir >> .runtime_version
save_plt_cache:
steps:
- save_cache:
key: v2-dialyzer-cache-{{ checksum ".runtime_version" }}-{{ checksum "mix.lock" }}
paths: "priv/plts"
restore_plt_cache:
steps:
- restore_cache:
keys:
- v2-dialyzer-cache-{{ checksum ".runtime_version" }}-{{ checksum "mix.lock" }}
- v2-dialyzer-cache-{{ checksum ".runtime_version" }}-
- v2-dialyzer-cache-
run_tests:
parameters:
glob:
type: string
split_by:
default: filesize
type: string
command:
type: string
steps:
- run:
command: |
circleci tests glob "<<parameters.glob>>" \
| circleci tests split --split-by=<<parameters.split_by>> \
| xargs <<parameters.command>>
jobs:
get_deps:
docker:
- image: membraneframeworklabs/docker_membrane
working_directory: ~/app
steps:
- checkout
- restore_deps_cache
- run: mix deps.get
- save_deps_cache
- persist_to_workspace:
root: .
paths: "*"
build_test:
docker:
- image: membraneframeworklabs/docker_membrane
environment:
MIX_ENV: test
working_directory: ~/app
steps:
- attach_workspace:
at: .
- restore_build_cache:
env: test
- run: mix deps.compile
- run: mix compile --force --warnings-as-errors
- save_build_cache:
env: test
- run: mix deps.unlock --check-unused
test:
docker:
- image: membraneframeworklabs/docker_membrane
environment:
MIX_ENV: test
working_directory: ~/app
parallelism: 4
steps:
- attach_workspace:
at: .
- restore_build_cache:
env: test
- run: mix compile
- run_tests:
glob: "test/membrane/**/*.exs"
split_by: "timings"
command: "mix test --include long_running"
- store_test_results:
path: "_build/test/lib/membrane_core"
lint:
docker:
- image: membraneframeworklabs/docker_membrane
environment:
MIX_ENV: dev
working_directory: ~/app
steps:
- attach_workspace:
at: .
- restore_build_cache:
env: dev
- run: mix compile
- save_build_cache:
env: dev
- run: mix format --check-formatted
- run: mix credo
- run: mix docs && mix docs 2>&1 | (! grep -q "warning:")
- gen_version_file
- restore_plt_cache
- run: mix dialyzer
- save_plt_cache
test_performance:
machine: true
resource_class: membraneframework/core-performance-test
working_directory: ~/app
steps:
- attach_workspace:
at: .
- run: cd app; git add -A; git reset --hard; cd ..
- run: cp -r benchmark/ ~/benchmark_backup/
- run: cp mix.exs ~/benchmark_backup/
- run: docker pull membraneframeworklabs/docker_membrane
- run: docker run -e MIX_ENV=benchmark -v ./:/root/app -v ~/results:/root/results -w /root/app membraneframeworklabs/docker_membrane mix do deps.get, deps.compile --force --all, compile --force, run benchmark/run.exs /root/results/feature_branch_results
- run: git checkout -f master
- run: cp ~/benchmark_backup/mix.exs ~/app
- run: docker run -e MIX_ENV=benchmark -v ./:/root/app -v ~/results:/root/results -v ~/benchmark_backup/benchmark:/root/app/benchmark -w /root/app membraneframeworklabs/docker_membrane mix do deps.get, deps.compile --force --all, compile --force, run benchmark/run.exs /root/results/master_results
- run: docker run -e MIX_ENV=benchmark -v ./:/root/app -v ~/results:/root/results -v ~/benchmark_backup/benchmark:/root/app/benchmark -w /root/app membraneframeworklabs/docker_membrane mix run benchmark/compare.exs /root/results/feature_branch_results /root/results/master_results
- run:
command: rm ~/results/*
when: always
orbs:
elixir: membraneframework/elixir@1
workflows:
version: 2
build_and_test:
jobs:
- get_deps
- build_test:
requires:
- get_deps
- test:
requires:
- get_deps
- lint:
requires:
- get_deps
- request_performance_test:
type: approval
filters:
branches:
ignore:
- /pull\/[0-9]+/
- /master/
- test_performance:
filters:
branches:
ignore:
- /pull\/[0-9]+/
- /master/
requires:
- get_deps
- request_performance_test
- elixir/hex_publish:
requires:
- build_test
- test
- lint
context:
- Deployment
filters:
branches:
ignore: /.*/
tags:
only: /v.*/