2022-12-14 10:51:42 -05:00
|
|
|
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
|
2024-05-31 07:51:55 -04:00
|
|
|
azureIAMCredentials:
|
|
|
|
description: "Azure IAM credentials used for cleaning up resources"
|
|
|
|
required: true
|
2023-05-12 11:14:32 -04:00
|
|
|
registry:
|
|
|
|
description: "Container registry to use"
|
|
|
|
required: true
|
|
|
|
githubToken:
|
|
|
|
description: "GitHub authorization token"
|
|
|
|
required: true
|
2022-12-14 10:51:42 -05:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Install terraform
|
2024-05-08 08:33:35 -04:00
|
|
|
uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
|
2022-12-14 10:51:42 -05:00
|
|
|
with:
|
|
|
|
terraform_wrapper: false
|
|
|
|
|
2023-03-20 11:05:08 -04:00
|
|
|
- name: Setup bazel
|
2023-10-04 07:55:38 -04:00
|
|
|
uses: ./.github/actions/setup_bazel_nix
|
2023-03-20 11:05:08 -04:00
|
|
|
|
2023-05-12 11:14:32 -04:00
|
|
|
- name: Log in to the Container registry
|
2023-06-06 06:20:09 -04:00
|
|
|
uses: ./.github/actions/container_registry_login
|
2023-05-12 11:14:32 -04:00
|
|
|
with:
|
|
|
|
registry: ${{ inputs.registry }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ inputs.githubToken }}
|
|
|
|
|
2022-12-14 10:51:42 -05:00
|
|
|
- name: MiniConstellation E2E
|
|
|
|
shell: bash
|
2024-05-31 07:51:55 -04:00
|
|
|
id: e2e-test
|
2023-01-18 04:15:58 -05:00
|
|
|
env:
|
|
|
|
ARM_CLIENT_ID: ${{ inputs.azureClientID }}
|
|
|
|
ARM_SUBSCRIPTION_ID: ${{ inputs.azureSubscriptionID }}
|
|
|
|
ARM_TENANT_ID: ${{ inputs.azureTenantID }}
|
2022-12-14 10:51:42 -05:00
|
|
|
run: |
|
2024-05-14 05:46:52 -04:00
|
|
|
bazel run --test_timeout=14400 //e2e/miniconstellation:push_remote_test
|
2024-05-31 07:51:55 -04:00
|
|
|
|
|
|
|
- name: Log in to azure
|
|
|
|
# only log in if e2e test failed or if the run was cancelled
|
|
|
|
if: (failure() && steps.e2e-test.conclusion == 'failure') || cancelled()
|
|
|
|
uses: ./.github/actions/login_azure
|
|
|
|
with:
|
|
|
|
azure_credentials: ${{ inputs.azureIAMCredentials }}
|
|
|
|
|
|
|
|
- name: Clean up after failure
|
|
|
|
shell: bash
|
|
|
|
# clean up if e2e test failed or if the run was cancelled
|
|
|
|
if: (failure() && steps.e2e-test.conclusion == 'failure') || cancelled()
|
|
|
|
run: |
|
|
|
|
rg_name=${{ steps.e2e-test.outputs.rgname }}
|
|
|
|
echo "[*] Deleting resource group $rg_name"
|
|
|
|
az group delete -y --resource-group "$rg_name"
|