Skip to content

[PERF-315 ] Github Action to Start/Stop VM #22

[PERF-315 ] Github Action to Start/Stop VM

[PERF-315 ] Github Action to Start/Stop VM #22

Workflow file for this run

# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: Start Azure VM
on:
pull_request:
branches:
- main
# workflow_dispatch:
env:
AzureADServicePrincipalPassword: ${{ secrets.AZURE_SERVICE_PRINCIPAL_PASSWORD }}
AzureADApplicationId: ${{ secrets.AZURE_TEST_VM_USER_NAME }}
AzureTenantId: ${{ secrets.AZURE_TENANT_ID }}
AzureSubscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
VmUserId: ${{ secrets.AZURE_TEST_VM_USER_NAME }}
AzureTestVmPassword: ${{ secrets.AZURE_TEST_VM_PASSWORD }}
jobs:
start-vm:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Start VM
if: ${{ env.AzureADServicePrincipalPassword != '' }}
shell: powershell
working-directory: ./eng/
run: |
Install-Module -Force -Name AzureRM -AllowClobber
Import-Module -Force -Name AzureRM
Write-host "Starting VM."
. $env:GITHUB_WORKSPACE/eng/AzureTestLab.ps1
Start-AzureManagementSession
Start-AzureVmsInParallel