Test EKS Cluster #548
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: Test EKS Cluster | |
on: | |
schedule: | |
- cron: '0 7 * * *' ## Every day at 0700 UTC | |
workflow_dispatch: ## Give us the ability to run this manually | |
inputs: | |
cluster_name: | |
type: string | |
default: zarf-nightly-eks-e2e-test | |
description: Name of the eks cluster that the test will create | |
instance_type: | |
type: string | |
default: t3.medium | |
description: EC2 instance type to use for the EKS cluster nodes | |
permissions: | |
id-token: write | |
contents: read | |
# Abort prior jobs in the same workflow / PR | |
concurrency: | |
group: e2e-eks-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup golang | |
uses: ./.github/actions/golang | |
- name: Build binary and zarf packages | |
uses: ./.github/actions/packages | |
- name: Auth with AWS | |
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 | |
with: | |
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }} | |
role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }} | |
aws-region: us-east-1 | |
role-duration-seconds: 7200 | |
- name: Build the eks package | |
run: ./build/zarf package create packages/distros/eks -o build --confirm | |
- name: Deploy the eks package | |
run: | | |
./build/zarf package deploy build/zarf-package-distro-eks-amd64-0.0.3.tar.zst \ | |
--components=deploy-eks-cluster \ | |
--set=EKS_CLUSTER_NAME=${{ inputs.cluster_name || 'zarf-nightly-eks-e2e-test' }} \ | |
--set=EKS_INSTANCE_TYPE=${{ inputs.instance_type || 't3.medium' }} \ | |
--confirm | |
- name: Run tests | |
run: make test-e2e-with-cluster ARCH=amd64 | |
- name: get pods | |
if: always() | |
run: kubectl get pods -n kiwix -o yaml | |
- name: describe pod | |
if: always() | |
run: kubectl describe pods -n kiwix | |
- name: get nodes | |
if: always() | |
run: kubectl get nodes -o yaml | |
- name: describe nodes | |
if: always() | |
run: kubectl describe nodes | |
- name: Teardown the cluster | |
if: always() | |
run: | | |
./build/zarf package deploy build/zarf-package-distro-eks-amd64-0.0.3.tar.zst \ | |
--components=teardown-eks-cluster \ | |
--set=EKS_CLUSTER_NAME=${{ inputs.cluster_name || 'zarf-nightly-eks-e2e-test' }} \ | |
--confirm | |
- name: Save logs | |
if: always() | |
uses: ./.github/actions/save-logs | |
- name: Send trigger to Slack on workflow failure | |
if: failure() | |
uses: ./.github/actions/slack | |
with: | |
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} |