-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (147 loc) · 5.02 KB
/
example.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: YC Load Testing example actions CI
run-name: load-testing
on:
- push
- workflow_dispatch
env:
WORKFLOW_ID: ${{ github.run_id }}
jobs:
# create 2 agents in cloud compute
#
create-agents:
name: create agents
runs-on: ubuntu-latest
outputs:
agent-ids: ${{ steps.create-agents.outputs.agent-ids }}
steps:
- id: create-agents
uses: yandex-cloud/yc-github-loadtesting-ci/agents-create@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
count: 2
service-account-id: ${{ vars.YC_LOADTESTING_AGENT_SA_ID }}
vm-zone: ru-central1-b
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}
path: ${{ steps.create-agents.outputs.artifacts-dir }}
# execute 2 multitests sequentially in a single suite
#
loadtesting-suite:
name: 'suite: 2 multi-agent tests'
continue-on-error: true
needs:
- create-agents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: run
uses: yandex-cloud/yc-github-loadtesting-ci/test-suite@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
test-directories: |-
"${{ github.workspace }}/_impl/testdata/http-const-rps-2-agents"
"${{ github.workspace }}/_impl/testdata/https-const-rps-2-agents"
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}
path: ${{ steps.run.outputs.artifacts-dir }}
# execute and check a single test
#
loadtesting-single-http:
name: '1 single-agent test (http)'
continue-on-error: true
needs:
- create-agents
- loadtesting-suite
runs-on: ubuntu-latest
env:
TEST_DIR: "${{ github.workspace }}/_impl/testdata/http-const-rps"
steps:
- uses: actions/checkout@v4
- id: run
uses: yandex-cloud/yc-github-loadtesting-ci/test-single-run@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
test-directory: "${{ env.TEST_DIR }}"
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-run
path: ${{ steps.run.outputs.artifacts-dir }}
- id: check
uses: yandex-cloud/yc-github-loadtesting-ci/test-single-check@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
test-id: ${{ steps.run.outputs.test-id }}
test-directory: "${{ env.TEST_DIR }}"
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-check
path: ${{ steps.check.outputs.artifacts-dir }}
# execute and check a single test
#
loadtesting-single-https:
name: '1 single-agent test (https)'
continue-on-error: true
needs:
- create-agents
- loadtesting-suite
runs-on: ubuntu-latest
env:
TEST_DIR: "${{ github.workspace }}/_impl/testdata/https-const-rps"
steps:
- uses: actions/checkout@v4
- id: run
uses: yandex-cloud/yc-github-loadtesting-ci/test-single-run@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
test-directory: "${{ env.TEST_DIR }}"
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-run
path: ${{ steps.run.outputs.artifacts-dir }}
- id: check
uses: yandex-cloud/yc-github-loadtesting-ci/test-single-check@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
test-id: ${{ steps.run.outputs.test-id }}
test-directory: "${{ env.TEST_DIR }}"
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-check
path: ${{ steps.check.outputs.artifacts-dir }}
# delete agents created in the first step
#
delete-agents:
name: delete agents
needs:
- create-agents
- loadtesting-suite
- loadtesting-single-http
- loadtesting-single-https
if: always()
runs-on: ubuntu-latest
steps:
- id: delete-agents
uses: yandex-cloud/yc-github-loadtesting-ci/agents-delete@main
with:
auth-key-json-base64: ${{ secrets.YC_LOADTESTING_KEY_JSON_BASE64 }}
folder-id: ${{ vars.YC_LOADTESTING_FOLDER_ID }}
agent-ids: ${{ needs.create-agents.outputs.agent-ids }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}
path: ${{ steps.delete-agents.outputs.artifacts-dir }}