dotnet-podcasts/.github/workflows/podcast-loadtest.yml

59 lines
1.7 KiB
YAML
Raw Normal View History

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:
env:
LOAD_TEST_RESOURCE: "podcast-alt"
LOAD_TEST_RESOURCE_GROUP: "podcast-alt-rg"
LOAD_TEST_LOCATION: "East US"
# 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: |
az group create --name "${{ env.LOAD_TEST_RESOURCE_GROUP }}" --location "${{ env.LOAD_TEST_LOCATION }}"
azPSVersion: "latest"
- name: Create Azure Load Testing resource
uses: azure/arm-deploy@v1
with:
resourceGroupName: ${{ env.LOAD_TEST_RESOURCE_GROUP }}
2022-09-10 02:31:28 +08:00
template: ./loadTest/template.json
parameters: ./loadTest/parameters.json name=${{ env.LOAD_TEST_RESOURCE }} location="${{ env.LOAD_TEST_LOCATION }}"
2022-09-10 02:19:59 +08:00
- name: 'Azure Load Testing'
uses: azure/load-testing@v1
with:
2022-09-10 10:12:06 +08:00
loadTestConfigFile: 'podcast-load.yml'
2022-09-10 02:19:59 +08:00
loadTestResource: ${{ env.LOAD_TEST_RESOURCE }}
resourceGroup: ${{ env.LOAD_TEST_RESOURCE_GROUP }}
# publish artifacts
- uses: actions/upload-artifact@v2
with:
name: loadTestResults
path: ${{ github.workspace }}/loadTest