forked from Stellabill/stellabill-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 1.84 KB
/
Copy pathk6-load-test-smoke.yml
File metadata and controls
63 lines (57 loc) · 1.84 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
name: K6 Load Test Smoke
on:
pull_request:
branches: [main, master, develop]
jobs:
load-test-smoke:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Setup k6
run: |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6-stable.list
sudo apt-get update
sudo apt-get install -y k6
- name: Run server
run: |
go run ./cmd/server &
echo "Server started"
sleep 10
env:
DATABASE_URL: postgres://test:test@localhost:5432/test?sslmode=disable
JWT_SECRET: dev-secret
- name: Run Load Test Smoke
run: |
k6 run scripts/loadtest/plans.js --out=json=plans_results.json
k6 run scripts/loadtest/subscriptions.js --out=json=subscriptions_results.json
k6 run scripts/loadtest/statements.js --out=json=statements_results.json
env:
JWT_SECRET: dev-secret
- name: Upload Results
if: always()
uses: actions/upload-artifact@v4
with:
name: k6-smoke-results
path: |
plans_results.json
subscriptions_results.json
statements_results.json