-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (36 loc) · 1.45 KB
/
start-VM.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
# 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
if (Get-IsWindows -and -not Get-InstalledModule | Where-Object -Property Name -eq "AzureRM") {
Import-Module -Force -Scope CurrentUser -Name AzureRM
}
Write-host "Starting VM."
. $env:GITHUB_WORKSPACE/eng/AzureTestLab.ps1
Start-AzureManagementSession
Start-AzureVmsInParallel