Running E2E for aws (feat/opentofu) #437
Workflow file for this run
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: E2E | |
run-name: Running E2E for ${{ inputs.cloud }} (${{ github.ref_name }}) | |
on: | |
workflow_call: | |
inputs: | |
cloud: | |
default: aws | |
required: false | |
type: string | |
use_helm: | |
default: false | |
required: false | |
type: boolean | |
version: | |
default: ci | |
required: false | |
type: string | |
workflow_dispatch: | |
inputs: | |
cloud: | |
description: Cloud to run against | |
required: false | |
default: "aws" | |
type: choice | |
options: | |
- aws | |
- azurerm | |
use_helm: | |
description: Indicates we install the controller via official helm chart | |
required: false | |
type: boolean | |
default: false | |
version: | |
description: Version of controller to check against | |
required: false | |
default: ci | |
jobs: | |
controller-image: | |
if: (github.event.inputs || inputs).version == 'ci' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: images/Dockerfile.controller | |
tags: ghcr.io/appvia/terranetes-controller:ci | |
outputs: type=docker,dest=/tmp/controller-image.tar | |
- name: Save | |
uses: actions/upload-artifact@v4 | |
with: | |
name: controller-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }} | |
path: /tmp/controller-image.tar | |
retention-days: 1 | |
executor-image: | |
if: (github.event.inputs || inputs).version == 'ci' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: images/Dockerfile.executor | |
tags: ghcr.io/appvia/terranetes-executor:ci | |
outputs: type=docker,dest=/tmp/executor-image.tar | |
- name: Save | |
uses: actions/upload-artifact@v4 | |
with: | |
name: executor-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }} | |
path: /tmp/executor-image.tar | |
retention-days: 1 | |
e2e: | |
if: always() | |
needs: | |
- controller-image | |
- executor-image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Requirements | |
run: | | |
sudo apt update -y | |
sudo apt install bats jq | |
- name: Install Kubectl | |
uses: azure/setup-kubectl@v4 | |
with: | |
version: v1.28.0 | |
- name: Install Kind | |
run: | | |
curl -sL https://github.com/kubernetes-sigs/kind/releases/download/v0.20.0/kind-linux-amd64 -o kind | |
chmod +x kind | |
kind create cluster | |
- name: Retrieve Controller Image | |
if: (github.event.inputs || inputs).version == 'ci' | |
uses: actions/download-artifact@v4 | |
with: | |
name: controller-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }} | |
path: /tmp | |
- name: Retrieve Executor Image | |
if: (github.event.inputs || inputs).version == 'ci' | |
uses: actions/download-artifact@v4 | |
with: | |
name: executor-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }} | |
path: /tmp | |
- name: Load images | |
if: (github.event.inputs || inputs).version == 'ci' | |
run: | | |
kind load image-archive /tmp/controller-image.tar | |
kind load image-archive /tmp/executor-image.tar | |
- name: Running E2E | |
run: | | |
test/e2e/check-suite.sh \ | |
--cloud ${{ (github.event.inputs || inputs).cloud }} \ | |
--use-chart ${{ (github.event.inputs || inputs).use_helm }} \ | |
--version ${{ (github.event.inputs || inputs).version }} | |
env: | |
ARM_CLIENT_ID: ${{ secrets.E2E_ARM_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.E2E_ARM_CLIENT_SECRET }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.E2E_ARM_SUBSCRIPTION_ID }} | |
ARM_TENANT_ID: ${{ secrets.E2E_ARM_TENANT_ID }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }} | |
AWS_REGION: ${{ secrets.E2E_AWS_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }} | |
DIAGNOSTICS: ${{ secrets.DIAGNOSTICS }} | |
E2E_SSH_DEPLOYMENT_KEY: ${{ secrets.E2E_SSH_DEPLOYMENT_KEY }} | |
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} | |
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }} |