Test Infra #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# perfTestClusterSetup: | |
# runs-on: ubuntu-latest | |
# steps: | |
# # Login | |
# - name: Azure Login | |
# run: az login --service-principal -u ${{ secrets.test_deploy_sp_id }} -p ${{ secrets.test_deploy_sp_secret }} --tenant ${{ secrets.test_tenant_id }} | |
# # 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) | |
# shell: bash | |
# run: | | |
# # Retrieve cluster name | |
# clusterName=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='perf'].name" -o tsv) | |
# state=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='perf'].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 }} ${{ secrets.test_tenant_id }} ${{ secrets.TESTER_SP_ID }} |