2022-07-13 08:04:46 -04:00
|
|
|
name: E2E test
|
2022-05-09 03:45:59 -04:00
|
|
|
description: "Run Constellation e2e test."
|
|
|
|
inputs:
|
|
|
|
workerNodesCount:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Number of worker nodes to spawn."
|
2022-05-09 03:45:59 -04:00
|
|
|
required: true
|
|
|
|
controlNodesCount:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Number of control-plane nodes to spawn."
|
2022-05-09 03:45:59 -04:00
|
|
|
required: true
|
|
|
|
autoscale:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Autoscale?"
|
2022-05-09 03:45:59 -04:00
|
|
|
required: true
|
|
|
|
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-05-09 03:45:59 -04:00
|
|
|
required: true
|
2022-08-09 09:29:39 -04:00
|
|
|
coreosImage:
|
|
|
|
description: "CoreOS image to run. The default value 'debug-latest' will select the latest available debug image."
|
|
|
|
default: "debug-latest"
|
|
|
|
required: true
|
|
|
|
isDebugImage:
|
|
|
|
description: "Is CoreOS img a debug img?"
|
|
|
|
default: "true"
|
|
|
|
required: true
|
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-05-09 03:45:59 -04:00
|
|
|
azure_credentials:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Credentials authorized to create Constellation on Azure."
|
2022-05-09 03:45:59 -04:00
|
|
|
required: false
|
|
|
|
sonobuoyTestSuiteCmd:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Which tests should be run? Check README for guidance!"
|
2022-05-09 03:45:59 -04:00
|
|
|
required: true
|
2022-08-09 04:02:15 -04:00
|
|
|
kubernetesVersion:
|
|
|
|
description: "Kubernetes version to create the cluster from."
|
|
|
|
required: false
|
2022-05-09 03:45:59 -04:00
|
|
|
msTeamsWebhook:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "WebHook used to notify of failure."
|
2022-05-09 03:45:59 -04:00
|
|
|
required: true
|
2022-07-13 08:04:46 -04:00
|
|
|
cosignPublicKey:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Cosign public key to sign measurements."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
|
|
|
cosignPrivateKey:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Cosign private key to sign measurements."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
|
|
|
cosignPassword:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "Cosign password for private key."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
|
|
|
awsAccessKeyID:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "AWS access key ID to upload measurements."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
|
|
|
awsSecretAccessKey:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "AWS secrets access key to upload measurements."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
|
|
|
awsDefaultRegion:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "AWS region of S3 bucket. to upload measurements."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
|
|
|
awsBucketName:
|
2022-08-09 04:02:15 -04:00
|
|
|
description: "AWS S3 bucket name to upload measurements."
|
2022-07-13 08:04:46 -04:00
|
|
|
required: false
|
2022-08-30 07:42:14 -04:00
|
|
|
azureClientSecret:
|
|
|
|
description: "The client secret value of the used secret"
|
|
|
|
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-08-09 04:02:15 -04:00
|
|
|
- name: Build CLI
|
|
|
|
uses: ./.github/actions/build_cli
|
2022-08-09 09:29:39 -04:00
|
|
|
- name: Build the bootstrapper
|
|
|
|
id: build-bootstrapper
|
|
|
|
uses: ./.github/actions/build_bootstrapper
|
|
|
|
if: ${{ inputs.isDebugImage == 'true' }}
|
|
|
|
- name: Build debugd
|
|
|
|
id: build-debugd
|
|
|
|
uses: ./.github/actions/build_debugd
|
|
|
|
if: ${{ inputs.isDebugImage == 'true' }}
|
2022-05-09 03:45:59 -04:00
|
|
|
|
2022-08-09 04:02:15 -04:00
|
|
|
- name: Login to GCP
|
|
|
|
uses: ./.github/actions/gcp_login
|
|
|
|
with:
|
|
|
|
gcp_service_account_json: ${{ inputs.gcp_service_account_json }}
|
|
|
|
if: ${{ inputs.cloudProvider == 'gcp' }}
|
|
|
|
- name: Login to Azure
|
|
|
|
uses: ./.github/actions/azure_login
|
|
|
|
with:
|
|
|
|
azure_credentials: ${{ inputs.azure_credentials }}
|
|
|
|
if: ${{ inputs.cloudProvider == 'azure' }}
|
2022-05-09 03:45:59 -04:00
|
|
|
|
2022-08-09 04:02:15 -04:00
|
|
|
- name: Create cluster
|
|
|
|
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
|
|
|
autoscale: ${{ inputs.autoscale }}
|
|
|
|
workerNodesCount: ${{ inputs.workerNodesCount }}
|
|
|
|
controlNodesCount: ${{ inputs.controlNodesCount }}
|
|
|
|
machineType: ${{ inputs.machineType }}
|
2022-08-09 09:29:39 -04:00
|
|
|
coreosImage: ${{ inputs.coreosImage }}
|
|
|
|
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-08-09 04:02:15 -04:00
|
|
|
- name: Measure cluster
|
|
|
|
uses: ./.github/actions/constellation_measure
|
|
|
|
with:
|
|
|
|
cloudProvider: ${{ inputs.cloudProvider }}
|
|
|
|
cosignPublicKey: ${{ inputs.cosignPublicKey }}
|
|
|
|
cosignPrivateKey: ${{ inputs.cosignPrivateKey }}
|
|
|
|
cosignPassword: ${{ inputs.cosignPassword }}
|
|
|
|
awsAccessKeyID: ${{ inputs.awsAccessKeyID }}
|
|
|
|
awsSecretAccessKey: ${{ inputs.awsSecretAccessKey }}
|
|
|
|
awsDefaultRegion: ${{ inputs.awsDefaultRegion }}
|
|
|
|
awsBucketName: ${{ inputs.awsBucketName }}
|
|
|
|
- name: Run e2e tests
|
|
|
|
uses: ./.github/actions/sonobuoy
|
|
|
|
with:
|
|
|
|
sonobuoyTestSuiteCmd: ${{ inputs.sonobuoyTestSuiteCmd }}
|
2022-05-09 03:45:59 -04:00
|
|
|
|
2022-08-09 04:02:15 -04:00
|
|
|
- name: Notify teams channel
|
|
|
|
if: ${{ failure() && github.ref == 'refs/heads/main' }}
|
|
|
|
run: |
|
|
|
|
sudo apt-get install gettext-base -y
|
|
|
|
export TEAMS_JOB_NAME=${{ inputs.cloudProvider }}
|
|
|
|
export TEAMS_RUN_ID=${{ github.run_id }}
|
|
|
|
envsubst < teams-payload.json > to-be-send.json
|
|
|
|
curl \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-d @to-be-send.json \
|
|
|
|
"${{ inputs.msTeamsWebhook }}"
|
|
|
|
shell: bash
|
|
|
|
working-directory: .github/actions/e2e_test
|
2022-05-09 03:45:59 -04:00
|
|
|
|
2022-08-09 04:02:15 -04:00
|
|
|
- name: Always terminate cluster
|
|
|
|
if: always()
|
|
|
|
uses: ./.github/actions/constellation_destroy
|