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

58 lines
1.7 KiB
YAML

# 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: "Demo-Podcast-EUS"
LOAD_TEST_RESOURCE_GROUP: "demo-podcast"
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
uses: actions/checkout@v3
- 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 }}
template: ./Test/ARMTemplate/template.json
parameters: ./Test/ARMTemplate/parameters.json name=${{ env.LOAD_TEST_RESOURCE }} location="${{ env.LOAD_TEST_LOCATION }}"
- name: 'Azure Load Testing'
uses: azure/load-testing@v1
with:
loadTestConfigFile: 'Test/config.yml'
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