Add support for testing aws-hosted-cp
#640
Workflow file for this run
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: E2E Tests | |
concurrency: | |
group: test-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
paths-ignore: | |
- 'config/**' | |
- '**.md' | |
env: | |
GO_VERSION: '1.22' | |
AWS_REGION: us-west-2 | |
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }} | |
jobs: | |
e2etest: | |
name: E2E Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Set up Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get outputs | |
id: vars | |
run: | | |
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT | |
echo "clustername=ci-$(date +%s)-e2e-test" >> $GITHUB_OUTPUT | |
- name: Build and push HMC controller image | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: | | |
LD_FLAGS=-s -w -X github.com/Mirantis/hmc/internal/build.Version=${{ steps.vars.outputs.version }} | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/mirantis/hmc/controller-ci:${{ steps.vars.outputs.version }} | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Prepare and push HMC template charts | |
run: | | |
make hmc-chart-release | |
REGISTRY_REPO="oci://ghcr.io/mirantis/hmc/charts-ci" make helm-push | |
- name: Setup kubectl | |
uses: azure/setup-kubectl@v4 | |
- name: Run E2E tests | |
env: | |
REGISTRY_REPO: 'oci://ghcr.io/mirantis/hmc/charts-ci' | |
IMG: 'ghcr.io/mirantis/hmc/controller-ci:${{ steps.vars.outputs.version }}' | |
MANAGED_CLUSTER_NAME: '${{ steps.vars.outputs.clustername }}' | |
run: | | |
make test-e2e | |
- name: Archive test results | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-logs | |
path: | | |
test/e2e/*.log | |
- name: Cleanup test resources | |
if: always() | |
env: | |
CLUSTER_NAME: '${{ steps.vars.outputs.clustername }}' | |
run: | | |
make dev-aws-nuke |