-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.36 KB
/
k6.yaml
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
name: Performance test
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
k6:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: "products:latest"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run container from image
run: docker run -d -p 8080:8080 products:latest
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v0.44.0/k6-v0.44.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run the container monitor script in the background
run: python .github/scripts/monitor.py products:latest system.html &
- name: Run the tests
run: ./k6 run tests/k6/test.js --vus 10 --duration 30s
- name: Archive k6 test result
uses: actions/upload-artifact@v3
with:
name: k6
path: k6.html
- name: Archive system resources diagrams
uses: actions/upload-artifact@v3
with:
name: system
path: system.html