e2e #10
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| region: | |
| description: AWS region | |
| default: us-east-1 | |
| type: string | |
| pull_request: | |
| types: [labeled] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| jobs: | |
| setup: | |
| if: >- | |
| github.event_name == 'workflow_dispatch' || | |
| github.event.label.name == 'e2e' | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| outputs: | |
| version: v0.0.0-e2e-${{ github.run_id }} | |
| ami_id: ${{ steps.ami.outputs.ami_id }} | |
| bucket: ${{ steps.bucket.outputs.name }} | |
| scenarios: ${{ steps.scenarios.outputs.list }} | |
| env: | |
| VERSION: v0.0.0-e2e-${{ github.run_id }} | |
| AWS_REGION: ${{ inputs.region || 'us-east-1' }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Select scenarios | |
| id: scenarios | |
| run: | | |
| if [ -f hack/upgrade-from ]; then | |
| echo 'list=["fresh","upgrade"]' >> ${GITHUB_OUTPUT} | |
| else | |
| echo 'list=["fresh"]' >> ${GITHUB_OUTPUT} | |
| fi | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_E2E_ROLE_ARN }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Build artifacts | |
| run: | | |
| make release-one VERSION=${VERSION} OS=linux ARCH=amd64 | |
| make image VERSION=${VERSION} | |
| make stackbot VERSION=${VERSION} | |
| - name: Upload keights binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: keights-linux-amd64 | |
| path: _output/staging/keights/linux/amd64/keights | |
| retention-days: 1 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push snapshot image to GHCR | |
| run: make image-push VERSION=${VERSION} | |
| - name: Build and tag AMI | |
| id: ami | |
| run: | | |
| make ami VERSION=${VERSION} SUBNET_ID=${{ secrets.E2E_CP_SUBNET_ID }} | |
| make ami-tag | |
| echo "ami_id=$(cat _output/ami/ami-id)" >> ${GITHUB_OUTPUT} | |
| - name: Create stackbot S3 bucket | |
| id: bucket | |
| run: | | |
| name=$(make -s stackbot-bucket-create) | |
| echo "name=${name}" >> ${GITHUB_OUTPUT} | |
| - name: Upload stackbot zips | |
| run: | | |
| make stackbot-upload \ | |
| VERSION=${VERSION} \ | |
| BUCKET=${{ steps.bucket.outputs.name }} \ | |
| PREFIX=lambda | |
| e2e: | |
| needs: setup | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| scenario: ${{ fromJson(needs.setup.outputs.scenarios) }} | |
| env: | |
| VERSION: ${{ needs.setup.outputs.version }} | |
| CLUSTER_NAME: e2e-${{ github.run_id }}-${{ matrix.scenario }} | |
| AWS_REGION: ${{ inputs.region || 'us-east-1' }} | |
| CLUSTER_DIR: ${{ github.workspace }}/cluster | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: keights-linux-amd64 | |
| path: _output/staging/keights/linux/amd64 | |
| - run: chmod +x _output/staging/keights/linux/amd64/keights | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_E2E_ROLE_ARN }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Provision cluster | |
| run: | | |
| make cluster-provision \ | |
| VERSION=${VERSION} \ | |
| SCENARIO=${{ matrix.scenario }} \ | |
| CLUSTER_NAME=${CLUSTER_NAME} \ | |
| CLUSTER_DIR=${CLUSTER_DIR} \ | |
| VPC_ID=${{ secrets.E2E_VPC_ID }} \ | |
| CP_SUBNET_ID=${{ secrets.E2E_CP_SUBNET_ID }} \ | |
| NODE_SUBNET_IDS=${{ secrets.E2E_NODE_SUBNET_IDS }} \ | |
| MODULE_SOURCE=${{ github.workspace }}/terraform \ | |
| STACKBOT_BUCKET=${{ needs.setup.outputs.bucket }} \ | |
| KMS_KEY_ID=${{ secrets.E2E_KMS_KEY_ID }} | |
| - name: Wait for cluster | |
| run: make cluster-wait CLUSTER_NAME=${CLUSTER_NAME} | |
| - name: Run conformance tests | |
| env: | |
| KUBECONFIG: ${{ github.workspace }}/kubeconfig | |
| run: | | |
| make cluster-kubeconfig CLUSTER_NAME=${CLUSTER_NAME} OUTPUT=${KUBECONFIG} | |
| make e2e-run | |
| - name: Destroy cluster | |
| if: always() | |
| run: make cluster-destroy CLUSTER_DIR=${CLUSTER_DIR} || true | |
| cleanup: | |
| needs: [setup, e2e] | |
| if: always() | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| env: | |
| VERSION: ${{ needs.setup.outputs.version }} | |
| AWS_REGION: ${{ inputs.region || 'us-east-1' }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_E2E_ROLE_ARN }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Destroy AMI | |
| if: needs.setup.outputs.ami_id != '' | |
| run: | | |
| mkdir -p _output/ami | |
| echo "${{ needs.setup.outputs.ami_id }}" > _output/ami/ami-id | |
| make ami-destroy | |
| - name: Delete stackbot bucket | |
| if: needs.setup.outputs.bucket != '' | |
| run: make stackbot-bucket-delete BUCKET=${{ needs.setup.outputs.bucket }} | |
| - name: Delete snapshot image from GHCR | |
| continue-on-error: true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: make image-delete VERSION=${VERSION} |