Skip to content

Integration tests

Integration tests #7

Workflow file for this run

name: E2E Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# This workflow runs e2e tests and relies on existance of EKS cluster with a `s3-csi-driver-sa` service account
# already deployed to it, which provides the driver with access to s3.
#
# Since we have a single cluster for e2e tests, we ensure that no more than one instance of this workflow is
# running by `concurrency: e2e-cluster` option.
concurrency: e2e-cluster
env:
AWS_REGION : "us-east-1"
KUBECONFIG: "/tmp/kubeconfig"
COMMIT_ID: ${{ github.event_name == 'push' && github.sha || github.event.pull_request.head.sha }}
jobs:
build:
# this is to prevent the job to run at forked projects
if: github.repository == 'awslabs/aws-s3-csi-driver'
runs-on: ubuntu-latest
environment: PR Integration Tests
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::239424963615:role/S3CSIDriverE2ETestsRole
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR Public Repository
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
BRANCH_OR_TAG=$(echo $GITHUB_REF | cut -d'/' -f3)
export PLATFORM=linux/amd64
export TAG=${{ env.COMMIT_ID }}
make build_image
make push_image
- name: Install the driver
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
export EKS_REGION=${{ env.AWS_REGION }}
export EKS_CLUSTER_NAME=s3-csi-cluster
export KUBECONFIG=${{ env.KUBECONFIG }}
export TAG=${{ env.COMMIT_ID }}
tests/e2e-kubernetes/install.sh
- name: Run E2E Tests
run: make e2e E2E_KUBECONFIG=${{ env.KUBECONFIG }} E2E_COMMIT_ID=${{ env.COMMIT_ID }}