100 lines
3.8 KiB
YAML
Raw Normal View History

2025-02-13 13:55:09 +01:00
name: e2e test emergency ssh
on:
workflow_dispatch:
push:
paths:
- cli/internal/cmd/ssh*.go
- terraform/infrastructure/aws/**
- terraform/infrastructure/azure/**
- terraform/infrastructure/gcp/**
jobs:
ssh:
2025-02-13 15:18:48 +01:00
runs-on: ubuntu-24.04
2025-02-13 13:55:09 +01:00
strategy:
matrix:
2025-02-13 14:47:22 +01:00
attestationVariant: ["gcp-sev-es", "gcp-sev-snp", "azure-sev-snp", "azure-tdx", "aws-sev-snp"]
2025-02-13 15:20:31 +01:00
steps:
- name: Checkout
2025-02-13 15:21:29 +01:00
id: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: Get Latest Image
id: find-latest-image
uses: ./.github/actions/find_latest_image
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: Split attestationVariant
2025-02-13 15:21:29 +01:00
id: split-attestationVariant
shell: bash
run: |
attestationVariant="${{ matrix.attestationVariant }}"
cloudProvider="${attestationVariant%%-*}"
2025-02-13 14:47:22 +01:00
2025-02-13 15:21:29 +01:00
echo "cloudProvider=${cloudProvider}" | tee -a "$GITHUB_OUTPUT"
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: test
uses: ./.github/actions/e2e_test
with:
workerNodesCount: "1"
controlNodesCount: "1"
cloudProvider: ${{ steps.split-attestationVariant.outputs.cloudProvider }}
attestationVariant: ${{ matrix.attestationVariant }}
osImage: ${{ steps.find-latest-image.outputs.image }}
isDebugImage: ${{ steps.find-latest-image.outputs.isDebugImage }}
gcpProject: constellation-e2e
gcpClusterCreateServiceAccount: "infrastructure-e2e@constellation-e2e.iam.gserviceaccount.com"
gcpIAMCreateServiceAccount: "iam-e2e@constellation-e2e.iam.gserviceaccount.com"
kubernetesVersion: "v1.28"
test: "emergency ssh"
azureSubscriptionID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azureClusterCreateCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
azureIAMCreateCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
registry: ghcr.io
githubToken: ${{ secrets.GITHUB_TOKEN }}
encryptionSecret: ${{ secrets.ARTIFACT_ENCRYPT_PASSWD }}
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: Always terminate cluster
if: always()
uses: ./.github/actions/constellation_destroy
with:
kubeconfig: ${{ steps.e2e_test.outputs.kubeconfig }}
clusterCreation: "cli"
cloudProvider: ${{ steps.split-attestationVariant.outputs.cloudProvider }}
azureClusterDeleteCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
gcpClusterDeleteServiceAccount: "infrastructure-e2e@constellation-e2e.iam.gserviceaccount.com"
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: Always delete IAM configuration
if: always()
uses: ./.github/actions/constellation_iam_destroy
with:
cloudProvider: ${{ steps.split-attestationVariant.outputs.cloudProvider }}
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "iam-e2e@constellation-e2e.iam.gserviceaccount.com"
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: Update tfstate
if: always()
env:
GH_TOKEN: ${{ github.token }}
uses: ./.github/actions/update_tfstate
with:
name: terraform-state-${{ steps.e2e_test.outputs.namePrefix }}
runID: ${{ github.run_id }}
encryptionSecret: ${{ secrets.ARTIFACT_ENCRYPT_PASSWD }}
2025-02-13 14:47:22 +01:00
2025-02-13 15:20:31 +01:00
- name: Notify about failure
if: |
failure() &&
github.ref == 'refs/heads/main' &&
github.event_name == 'schedule'
continue-on-error: true
uses: ./.github/actions/notify_e2e_failure
with:
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
refStream: ${{ matrix.refStream }}
test: ${{ matrix.test }}
kubernetesVersion: ${{ matrix.kubernetesVersion }}
provider: ${{ steps.split-attestationVariant.outputs.cloudProvider }}
attestationVariant: ${{ matrix.attestationVariant }}
clusterCreation: "cli"