2022-09-10 02:19:59 +08:00
|
|
|
# This is a basic workflow to help you get started with Actions
|
|
|
|
|
|
|
|
name: Podcast Load Test
|
|
|
|
|
|
|
|
# Controls when the workflow will run
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
loadTest:
|
|
|
|
name: Load Test
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout GitHub Actions
|
2022-09-10 03:06:35 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-09-10 02:19:59 +08:00
|
|
|
|
|
|
|
- name: Login to Azure
|
|
|
|
uses: azure/login@v1
|
|
|
|
continue-on-error: false
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Create Resource Group
|
|
|
|
uses: azure/powershell@v1
|
|
|
|
continue-on-error: false
|
|
|
|
with:
|
|
|
|
inlineScript: |
|
2023-02-09 23:56:25 +08:00
|
|
|
az group create --name "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}" --location "${{ secrets.LOAD_TEST_LOCATION }}"
|
2022-09-10 02:19:59 +08:00
|
|
|
azPSVersion: "latest"
|
|
|
|
|
2023-01-16 17:37:38 +08:00
|
|
|
- name: Create Azure Load Testing resource
|
|
|
|
uses: azure/arm-deploy@v1
|
|
|
|
with:
|
2023-02-09 23:56:25 +08:00
|
|
|
resourceGroupName: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
|
2023-01-17 01:00:24 +08:00
|
|
|
template: ./Test/ARMTemplate/template.json
|
2023-02-09 23:56:25 +08:00
|
|
|
parameters: ./Test/ARMTemplate/parameters.json name=${{ secrets.LOAD_TEST_RESOURCE }} location="${{ secrets.LOAD_TEST_LOCATION }}"
|
2022-09-10 02:19:59 +08:00
|
|
|
|
|
|
|
- name: 'Azure Load Testing'
|
|
|
|
uses: azure/load-testing@v1
|
|
|
|
with:
|
2023-01-17 01:00:24 +08:00
|
|
|
loadTestConfigFile: 'Test/config.yml'
|
2023-02-09 23:56:25 +08:00
|
|
|
loadTestResource: ${{ secrets.LOAD_TEST_RESOURCE }}
|
|
|
|
resourceGroup: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
|
|
|
|
env: |
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"name": "webapp",
|
|
|
|
"value": "${{ secrets.WEBAPP_NAME }}.azurewebsites.net"
|
|
|
|
}
|
|
|
|
]
|
2022-09-10 02:19:59 +08:00
|
|
|
|
|
|
|
# publish artifacts
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: loadTestResults
|
|
|
|
path: ${{ github.workspace }}/loadTest
|