2022-10-24 12:47:03 -04:00
name : E2E meta test
description : "This test does the infrastructure management and runs the e2e test of your choice."
2022-05-09 03:45:59 -04:00
inputs :
workerNodesCount :
2022-08-09 04:02:15 -04:00
description : "Number of worker nodes to spawn."
2022-10-24 12:47:03 -04:00
required : false
default : "2"
2022-05-09 03:45:59 -04:00
controlNodesCount :
2022-08-09 04:02:15 -04:00
description : "Number of control-plane nodes to spawn."
2022-10-24 12:47:03 -04:00
required : false
default : "3"
2022-05-09 03:45:59 -04:00
cloudProvider :
2022-08-09 04:02:15 -04:00
description : "Which cloud provider to use."
2022-05-09 03:45:59 -04:00
required : true
machineType :
2022-08-09 04:02:15 -04:00
description : "VM machine type. Make sure it matches selected cloud provider!"
2022-09-03 04:21:19 -04:00
required : false
2022-10-21 04:16:44 -04:00
osImage :
description : "OS image to run. The default value 'debug-latest' will select the latest available debug image."
2022-08-09 09:29:39 -04:00
default : "debug-latest"
required : true
isDebugImage :
2022-10-21 04:16:44 -04:00
description : "Is OS img a debug img?"
2022-08-09 09:29:39 -04:00
default : "true"
required : true
2022-09-13 10:01:47 -04:00
kubernetesVersion :
description : "Kubernetes version to create the cluster from."
required : false
2022-05-09 03:45:59 -04:00
gcp_service_account_json :
2022-08-09 04:02:15 -04:00
description : "Service account with permissions to create Constellation on GCP."
2022-05-09 03:45:59 -04:00
required : false
2022-08-29 02:55:36 -04:00
gcpClusterServiceAccountKey :
description : "Service account to use inside the created Constellation cluster on GCP."
required : false
2022-08-30 07:42:14 -04:00
azureClientSecret :
description : "The client secret value of the used secret"
required : false
2022-09-02 06:43:04 -04:00
azureResourceGroup :
description : "The resource group to use"
required : false
2022-10-24 12:47:03 -04:00
test :
description : "The test to run. Can currently be one of [sonobuoy full, sonobuoy fast, autoscaling]."
2022-09-13 10:01:47 -04:00
required : true
2022-10-24 12:47:03 -04:00
sonobuoyTestSuiteCmd :
description : "The sonobuoy test suite to run."
required : false
2022-08-09 09:29:39 -04:00
2022-05-09 03:45:59 -04:00
runs :
2022-08-09 04:02:15 -04:00
using : "composite"
2022-05-09 03:45:59 -04:00
steps :
2022-10-24 12:47:03 -04:00
- name : Check input
if : ${{ !contains(fromJson('["sonobuoy full", "sonobuoy fast", "autoscaling"]'), inputs.test) }}
shell : bash
run : |
echo "Invalid input for test field: ${{ inputs.test }}"
exit 1
2022-09-14 11:41:47 -04:00
- name : Determine build target
id : determine-build-target
shell : bash
run : |
2022-10-12 05:43:32 -04:00
echo "hostOS=$(go env GOOS)" >> $GITHUB_OUTPUT
echo "hostArch=$(go env GOARCH)" >> $GITHUB_OUTPUT
2022-09-14 11:41:47 -04:00
2022-08-09 04:02:15 -04:00
- name : Build CLI
uses : ./.github/actions/build_cli
2022-09-14 11:41:47 -04:00
with :
targetOS : ${{ steps.determine-build-target.outputs.hostOS }}
targetArch : ${{ steps.determine-build-target.outputs.hostArch }}
# macOS runners don't have Docker preinstalled, so they cannot build the bootstrapper.
# But we can use a Linux runner to build it and store/retrieve it from the action cache.
- name : Download the bootstrapper from cache
id : download-bootstrapper-cache
if : inputs.isDebugImage == 'true' && runner.os == 'macOS'
2022-10-13 17:55:12 -04:00
uses : actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3.0.11
2022-09-14 11:41:47 -04:00
with :
key : bootstrapper-${{ github.sha }}
path : "build/bootstrapper"
2022-08-09 09:29:39 -04:00
- name : Build the bootstrapper
id : build-bootstrapper
2022-09-14 11:41:47 -04:00
if : inputs.isDebugImage == 'true' && runner.os != 'macOS'
2022-10-24 12:47:03 -04:00
uses : ./.github/actions/build_bootstrapper
2022-09-14 11:41:47 -04:00
- name : Build cdbg
id : build-cdbg
if : inputs.isDebugImage == 'true'
2022-10-24 12:47:03 -04:00
uses : ./.github/actions/build_cdbg
2022-09-14 11:41:47 -04:00
with :
targetOS : ${{ steps.determine-build-target.outputs.hostOS }}
targetArch : ${{ steps.determine-build-target.outputs.hostArch }}
2022-05-09 03:45:59 -04:00
2022-08-09 04:02:15 -04:00
- name : Login to GCP
2022-10-24 12:47:03 -04:00
if : inputs.cloudProvider == 'gcp'
2022-08-09 04:02:15 -04:00
uses : ./.github/actions/gcp_login
with :
gcp_service_account_json : ${{ inputs.gcp_service_account_json }}
2022-05-09 03:45:59 -04:00
2022-08-09 04:02:15 -04:00
- name : Create cluster
2022-10-24 12:47:03 -04:00
id : constellation-create
2022-08-09 04:02:15 -04:00
uses : ./.github/actions/constellation_create
with :
cloudProvider : ${{ inputs.cloudProvider }}
2022-08-29 02:55:36 -04:00
gcpClusterServiceAccountKey : ${{ inputs.gcpClusterServiceAccountKey }}
2022-08-09 04:02:15 -04:00
workerNodesCount : ${{ inputs.workerNodesCount }}
controlNodesCount : ${{ inputs.controlNodesCount }}
machineType : ${{ inputs.machineType }}
2022-10-21 04:16:44 -04:00
osImage : ${{ inputs.osImage }}
2022-08-09 09:29:39 -04:00
isDebugImage : ${{ inputs.isDebugImage }}
2022-08-09 04:02:15 -04:00
kubernetesVersion : ${{ inputs.kubernetesVersion }}
2022-08-30 07:42:14 -04:00
azureClientSecret : ${{ inputs.azureClientSecret }}
2022-09-02 06:43:04 -04:00
azureResourceGroup : ${{ inputs.azureResourceGroup }}
2022-10-24 12:47:03 -04:00
#
# Test payloads
#
- name : Run sonobuoy fast test
if : inputs.test == 'sonobuoy fast'
2022-08-09 04:02:15 -04:00
uses : ./.github/actions/sonobuoy
with :
2022-10-24 12:47:03 -04:00
sonobuoyTestSuiteCmd : "--mode quick"
kubeconfig : ${{ steps.constellation-create.outputs.kubeconfig }}
- name : Run sonobuoy full test
if : inputs.test == 'sonobuoy full'
uses : ./.github/actions/sonobuoy
with :
# TODO: Remove E2E_SKIP once AB#2174 is resolved
sonobuoyTestSuiteCmd : '--plugin e2e --plugin-env e2e.E2E_FOCUS="\[Conformance\]" --plugin-env e2e.E2E_SKIP="for service with type clusterIP|HostPort validates that there is no conflict between pods with same hostPort but different hostIP and protocol" --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-plugin.yaml --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-master-plugin.yaml'
kubeconfig : ${{ steps.constellation-create.outputs.kubeconfig }}
- name : Run autoscaling test
if : inputs.test == 'autoscaling'
uses : ./.github/actions/e2e_autoscaling
with :
kubeconfig : ${{ steps.constellation-create.outputs.kubeconfig }}