-
Notifications
You must be signed in to change notification settings - Fork 19
64 lines (55 loc) · 1.86 KB
/
test-infra.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Test Infra
on:
workflow_dispatch:
push:
branches:
- main
paths:
- deployment/integration-test/*
- .github/workflows/integration-test-infra.yaml
env:
rg: ---
jobs:
intTestClusterSetup:
runs-on: ubuntu-latest
steps:
- name: Azure Login
run: az login --service-principal -u ${{ secrets.deploy_sp_id }} -p ${{ secrets.deploy_sp_secret }} --tenant ${{ secrets.tenant_id }}
- name: Azure Subscription Selection
run: az account set -n "${{ secrets.TEST_SUB }}"
# Add Kusto extension to Azure CLI
- name: Install Kusto extension
run: az extension add -n kusto
# Turn cluster on
- name: Turn on cluster (if off)
run: |
# Retrieve cluster name
clusterName=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].name" -o tsv)
state=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].state" -o tsv)
echo "Cluster Name: $clusterName"
echo "State: $state"
if [ "$state" == "Stopped" ]
then
# Actually start the cluster
echo "Start cluster"
az kusto cluster start -n $clusterName -g ${{ secrets.test_rg }} -n $clusterName
else
echo "Do nothing"
fi
deploy:
needs:
- intTestClusterSetup
# - perfTestClusterSetup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Login
- name: Azure Login
run: az login --service-principal -u ${{ secrets.deploy_sp_id }} -p ${{ secrets.deploy_sp_secret }} --tenant ${{ secrets.tenant_id }}
- name: Azure Subscription Selection
run: az account set -n "${{ secrets.TEST_SUB }}"
# Deploy
- name: Deploy
run: |
cd deployment/integration-test
bash deploy-integration-test-infra.sh ${{ secrets.test_rg }}