-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.71 KB
/
performance-test.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
name: 📋 Performance Test
on:
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]
concurrency:
group: preview-${{ github.head_ref }}
cancel-in-progress: true
jobs:
performance-test:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Git clone the repository
uses: actions/checkout@v3
- name: Init
run: |
# Set permissions for checkout.
sudo chown -R 1000:1000 $(pwd)
# Create performance testing results directory.
sudo mkdir -p performance-testing/results
sudo chmod 777 performance-testing/results
- name: 📋 Setup
run: |
OTEL_PHP_AUTOLOAD_ENABLED=false docker compose up -d --wait
docker compose exec php-cli composer install --prefer-dist
docker compose exec php-cli ./vendor/drush/drush/drush si demo_umami -y
- name: Get K6 Baseline Test
run: |
docker run --rm --network=host -v $(pwd)/performance-testing/results:/results -i docker.io/grafana/k6 run - --summary-export=/results/baseline.json --vus 2 --duration 30s < performance-testing/scenarios/basic.js
- name: Enable OTEL
run: |
docker compose stop
docker compose up -d --wait
- name: Rerun K6 Test
run: |
docker run --rm --network=host -v $(pwd)/performance-testing/results:/results -i docker.io/grafana/k6 run - --summary-export=/results/otel.json --vus 2 --duration 30s < performance-testing/scenarios/basic.js
- name: Compare Tests
run: |
BUDGET=200
bash ./performance-testing/scripts/review_results.sh ./performance-testing/results/baseline.json ./performance-testing/results/otel.json ${BUDGET}