|
| 1 | +name: E2E Tests Lifecycle |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - 'cmd/vmcp/**' |
| 8 | + - 'cmd/thv-operator/**' |
| 9 | + - 'pkg/**' |
| 10 | + - 'test/e2e/thv-operator/**' |
| 11 | + - '.github/workflows/test-e2e-lifecycle.yml' |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +jobs: |
| 17 | + e2e-test-lifecycle: |
| 18 | + name: E2E Test Lifecycle |
| 19 | + runs-on: ubuntu-latest |
| 20 | + timeout-minutes: 20 |
| 21 | + env: |
| 22 | + YARDSTICK_IMAGE: ghcr.io/stackloklabs/yardstick/yardstick-server:0.0.2 |
| 23 | + defaults: |
| 24 | + run: |
| 25 | + shell: bash |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + version: [ |
| 30 | + "kindest/node:v1.32.8", |
| 31 | + "kindest/node:v1.33.4", |
| 32 | + "kindest/node:v1.34.0" |
| 33 | + ] |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Checkout code |
| 37 | + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 |
| 38 | + |
| 39 | + - name: Set up Helm |
| 40 | + uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 |
| 41 | + |
| 42 | + - name: Setup Ko |
| 43 | + uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 |
| 44 | + |
| 45 | + - name: Set up Go |
| 46 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 |
| 47 | + with: |
| 48 | + go-version-file: 'go.mod' |
| 49 | + cache: true |
| 50 | + |
| 51 | + - name: Install Task |
| 52 | + uses: arduino/setup-task@v2 |
| 53 | + with: |
| 54 | + version: 3.44.1 |
| 55 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + |
| 57 | + - name: Create KIND Cluster with port mappings |
| 58 | + uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # [email protected] |
| 59 | + with: |
| 60 | + cluster_name: toolhive |
| 61 | + version: v0.29.0 |
| 62 | + config: test/e2e/thv-operator/kind-config.yaml |
| 63 | + node_image: ${{ matrix.version }} |
| 64 | + |
| 65 | + - name: Setup cluster |
| 66 | + run: | |
| 67 | + kind get kubeconfig --name toolhive > kconfig.yaml |
| 68 | + export KUBECONFIG=kconfig.yaml |
| 69 | + task operator-install-crds |
| 70 | + task operator-deploy-local |
| 71 | +
|
| 72 | + - name: Build and load test images |
| 73 | + run: | |
| 74 | + # Build and load vmcp image |
| 75 | + echo "Building vmcp image..." |
| 76 | + VMCP_IMAGE=$(KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/vmcp | tail -n 1) |
| 77 | + echo "Loading vmcp image ${VMCP_IMAGE} into kind..." |
| 78 | + kind load docker-image --name toolhive ${VMCP_IMAGE} |
| 79 | +
|
| 80 | + # Pull and load test server image |
| 81 | + echo "Pulling and loading yardstick test server image..." |
| 82 | + docker pull ${{ env.YARDSTICK_IMAGE }} |
| 83 | + kind load docker-image --name toolhive ${{ env.YARDSTICK_IMAGE }} |
| 84 | +
|
| 85 | + - name: Run VirtualMCP Lifecycle E2E tests |
| 86 | + run: | |
| 87 | + export KUBECONFIG=kconfig.yaml |
| 88 | + task thv-operator-e2e-test-run |
| 89 | +
|
| 90 | + - name: Cleanup cluster |
| 91 | + if: always() |
| 92 | + run: | |
| 93 | + kind delete cluster --name toolhive |
0 commit comments