74 lines (70 loc) · 2.35 KB
/
github-actions-loadtest.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
# see the documentation here: https://github.com/marketplace/actions/azure-load-testing
name: Azure Load Test Demo
run-name: Run the API load test on VeloByte Stocks API 🚀
permissions:
id-token: write
contents: read
# Allows you to run this workflow manually from the Actions tab
on:
workflow_dispatch:
jobs:
run-load-test:
runs-on: ubuntu-latest
environment: Demo
steps:
- name: Checkout GitHub Actions
uses: actions/checkout@v2
# configured using OIDC
# OIDC documentation: https://learn.microsoft.com/en-us/azure/active-directory/workload-identities/workload-identity-federation-create-trust?pivots=identity-wif-apps-methods-azp#configure-a-federated-identity-credential-on-an-app
# Action documentation: https://github.com/Azure/login
- name: Login to Azure
uses: azure/login@v1
continue-on-error: false
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Azure Load Testing'
uses: azure/load-testing@v1
with:
loadtestConfigFile: loadTestConfig.yaml
loadtestResource: ${{ vars.LOAD_TEST_RESOURCE_NAME }}
resourceGroup: ${{ vars.RESOURCE_GROUP_NAME }}
env: |
[
{
"name": "app_scope",
"value": "${{ vars.APP_SCOPE }}"
},
{
"name": "site_uri",
"value": "${{ vars.SITE_URI }}"
},
{
"name": "site_port",
"value": "${{ vars.SITE_PORT }}"
},
{
"name": "csv_path",
"value": "tickers.csv"
}
]
secrets: |
[
{
"name": "app_client_id",
"value": "${{ secrets.APP_CLIENT_ID }}"
},
{
"name": "app_tenant_id",
"value": "${{ secrets.APP_TENANT_ID }}"
},
{
"name": "user_username",
"value": "${{ secrets.USER_USERNAME }}"
},
{
"name": "user_password",
"value": "${{ secrets.USER_PASSWORD }}"
}
]