-
Notifications
You must be signed in to change notification settings - Fork 45
64 lines (55 loc) · 2.11 KB
/
performance.yml
File metadata and controls
64 lines (55 loc) · 2.11 KB
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
name: Performance Test
# Replaces the CircleCI manual approval gate. Trigger this workflow
# manually from the Actions tab on the branch you want to benchmark.
on:
workflow_dispatch:
jobs:
performance:
runs-on: performance
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Back up benchmark and mix.exs
run: |
cp -r benchmark/ $HOME/benchmark_backup/
cp mix.exs $HOME/benchmark_backup/
- name: Pull Docker image
run: docker pull membraneframeworklabs/docker_membrane
- name: Run benchmarks on feature branch
run: |
mkdir -p $HOME/results
docker run \
-e MIX_ENV=benchmark \
-v $PWD:/root/app \
-v $HOME/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
- name: Switch to master and restore benchmark
run: |
git checkout -f master
cp $HOME/benchmark_backup/mix.exs .
- name: Run benchmarks on master
run: |
docker run \
-e MIX_ENV=benchmark \
-v $PWD:/root/app \
-v $HOME/results:/root/results \
-v $HOME/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
- name: Compare results
run: |
docker run \
-e MIX_ENV=benchmark \
-v $PWD:/root/app \
-v $HOME/results:/root/results \
-v $HOME/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
- name: Clean up results
if: always()
run: rm -f $HOME/results/*