constellation/.github/actions/e2e_mini/action.yml
Paul Meyer e011a20c49 deps: update to Go 1.20
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-02-20 12:08:24 -05:00

66 lines
2.0 KiB
YAML

name: E2E QEMU test
description: "Test MiniConstellation functionality on Azure VM."
inputs:
azureClientID:
description: "Azure client to use for login with OIDC"
required: true
azureSubscriptionID:
description: "Azure subscription to use for login with OIDC"
required: true
azureTenantID:
description: "Azure tenant to use for login with OIDC"
required: true
runs:
using: "composite"
steps:
- name: Install terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_wrapper: false
- name: Setup Go environment
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: "1.20.1"
- name: Build Constellation CLI
uses: ./.github/actions/build_cli
with:
enterpriseCLI: true
- name: MiniConstellation E2E
shell: bash
env:
ARM_CLIENT_ID: ${{ inputs.azureClientID }}
ARM_SUBSCRIPTION_ID: ${{ inputs.azureSubscriptionID }}
ARM_TENANT_ID: ${{ inputs.azureTenantID }}
run: |
echo "::group::Terraform"
cd .github/actions/e2e_mini
terraform init
terraform apply -auto-approve
terraform output -raw ssh_private_key > id_rsa
chmod 600 id_rsa
export AZURE_VM_IP=$(terraform output -raw public_ip)
echo "::endgroup::"
./wait-for-ssh.sh
# Copy locally build Constellation CLI and run e2e script.
scp -i id_rsa ../../../build/constellation adminuser@${AZURE_VM_IP}:.
ssh -i id_rsa adminuser@${AZURE_VM_IP} 'bash -s' < run-e2e.sh
- name: Delete deployment
if: always()
shell: bash
env:
ARM_CLIENT_ID: ${{ inputs.azureClientID }}
ARM_SUBSCRIPTION_ID: ${{ inputs.azureSubscriptionID }}
ARM_TENANT_ID: ${{ inputs.azureTenantID }}
run: |
echo "::group::Terminate"
cd .github/actions/e2e_mini
terraform destroy -auto-approve
echo "::endgroup::"