-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (73 loc) · 2.5 KB
/
Copy pathperf-tests.yml
File metadata and controls
82 lines (73 loc) · 2.5 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# =====================================================================
# Performance Framework - GitHub Actions Workflow
# ---------------------------------------------------------------------
# Place at: .github/workflows/perf-tests.yml
# Manual dispatch with inputs; Smoke gate -> Load profile -> artifacts.
# =====================================================================
name: Performance Tests
on:
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
type: choice
options: [dev, qa, uat, perf]
default: qa
testType:
description: 'Load profile'
type: choice
options: [Smoke, Load, Stress, Spike, Soak]
default: Load
users:
description: 'Virtual users'
default: '50'
rampup:
description: 'Ramp-up seconds'
default: '60'
duration:
description: 'Steady-state seconds'
default: '600'
schedule:
- cron: '0 2 * * 1' # nightly-ish: every Monday 02:00 UTC smoke+load
env:
JMETER_VERSION: 5.6.3
jobs:
performance:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Install Apache JMeter
run: |
set -e
curl -sSL "https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz" -o jmeter.tgz
tar -xzf jmeter.tgz
echo "JMETER_HOME=$PWD/apache-jmeter-${JMETER_VERSION}" >> "$GITHUB_ENV"
- name: Smoke Test (Quality Gate)
run: |
chmod +x scripts/run-test.sh
./scripts/run-test.sh SmokeTest "${{ github.event.inputs.environment || 'qa' }}"
- name: Load Profile
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
./scripts/run-test.sh "${{ github.event.inputs.testType }}Test" "${{ github.event.inputs.environment }}" \
-Jusers=${{ github.event.inputs.users }} \
-Jrampup=${{ github.event.inputs.rampup }} \
-Jduration=${{ github.event.inputs.duration }}
- name: Upload JTL results
if: always()
uses: actions/upload-artifact@v4
with:
name: jtl-results
path: results/**
- name: Upload HTML dashboard
if: always()
uses: actions/upload-artifact@v4
with:
name: html-dashboard
path: reports/**