|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +name: Branch Helm E2E |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - "pull-request/[0-9]+" |
| 10 | + workflow_dispatch: {} |
| 11 | + |
| 12 | +permissions: {} |
| 13 | + |
| 14 | +jobs: |
| 15 | + pr_metadata: |
| 16 | + name: Resolve PR metadata |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: read |
| 20 | + pull-requests: read |
| 21 | + outputs: |
| 22 | + should_run: ${{ steps.gate.outputs.should_run }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v6 |
| 25 | + |
| 26 | + - id: gate |
| 27 | + uses: ./.github/actions/pr-gate |
| 28 | + with: |
| 29 | + required_label: test:e2e-helm |
| 30 | + |
| 31 | + build-gateway: |
| 32 | + needs: [pr_metadata] |
| 33 | + if: needs.pr_metadata.outputs.should_run == 'true' |
| 34 | + permissions: |
| 35 | + contents: read |
| 36 | + packages: write |
| 37 | + uses: ./.github/workflows/docker-build.yml |
| 38 | + with: |
| 39 | + component: gateway |
| 40 | + platform: linux/amd64 |
| 41 | + |
| 42 | + build-supervisor: |
| 43 | + needs: [pr_metadata] |
| 44 | + if: needs.pr_metadata.outputs.should_run == 'true' |
| 45 | + permissions: |
| 46 | + contents: read |
| 47 | + packages: write |
| 48 | + uses: ./.github/workflows/docker-build.yml |
| 49 | + with: |
| 50 | + component: supervisor |
| 51 | + platform: linux/amd64 |
| 52 | + |
| 53 | + helm-e2e: |
| 54 | + name: Helm E2E (Rust smoke) |
| 55 | + needs: [pr_metadata, build-gateway, build-supervisor] |
| 56 | + if: needs.pr_metadata.outputs.should_run == 'true' |
| 57 | + # Bare runner: kind-in-container hits the same nested-Docker / kubeconfig |
| 58 | + # complications take-1 saw with k3d (commit 4b5961fe). The runner has |
| 59 | + # Docker; mise installs helm, kubectl, and the Rust toolchain. |
| 60 | + runs-on: linux-amd64-cpu8 |
| 61 | + timeout-minutes: 60 |
| 62 | + permissions: |
| 63 | + contents: read |
| 64 | + packages: read |
| 65 | + env: |
| 66 | + MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + KIND_CLUSTER_NAME: helm-e2e-${{ github.run_id }} |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v6 |
| 70 | + |
| 71 | + - name: Install mise |
| 72 | + run: | |
| 73 | + curl https://mise.run | sh |
| 74 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 75 | + echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH" |
| 76 | +
|
| 77 | + - name: Install tools |
| 78 | + run: mise install --locked |
| 79 | + |
| 80 | + - name: Log in to GHCR |
| 81 | + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin |
| 82 | + |
| 83 | + - name: Create kind cluster |
| 84 | + uses: helm/kind-action@v1 |
| 85 | + with: |
| 86 | + cluster_name: ${{ env.KIND_CLUSTER_NAME }} |
| 87 | + wait: 120s |
| 88 | + |
| 89 | + # mise.toml sets KUBECONFIG="{{config_root}}/kubeconfig"; helm/kind-action |
| 90 | + # writes to ~/.kube/config. Materialize the kind context at the mise path |
| 91 | + # so `mise run e2e:helm` (and the wrapper's `kubectl --context=…`) finds |
| 92 | + # the kind cluster. |
| 93 | + - name: Export kind kubeconfig to mise path |
| 94 | + run: | |
| 95 | + set -euo pipefail |
| 96 | + kind get kubeconfig --name "$KIND_CLUSTER_NAME" > "$GITHUB_WORKSPACE/kubeconfig" |
| 97 | + chmod 600 "$GITHUB_WORKSPACE/kubeconfig" |
| 98 | +
|
| 99 | + # Pre-pull and side-load: kind nodes don't have ghcr credentials, and |
| 100 | + # tagging IMAGE_TAG to a SHA means the chart's IfNotPresent pull policy |
| 101 | + # is satisfied once the image is loaded into the node's containerd. |
| 102 | + - name: Load gateway and supervisor images into kind |
| 103 | + run: | |
| 104 | + set -euo pipefail |
| 105 | + for component in gateway supervisor; do |
| 106 | + image="ghcr.io/nvidia/openshell/${component}:${{ github.sha }}" |
| 107 | + docker pull "$image" |
| 108 | + kind load docker-image "$image" --name "$KIND_CLUSTER_NAME" |
| 109 | + done |
| 110 | +
|
| 111 | + - name: Run Helm E2E (Rust smoke) |
| 112 | + env: |
| 113 | + OPENSHELL_E2E_KUBE_CONTEXT: kind-${{ env.KIND_CLUSTER_NAME }} |
| 114 | + IMAGE_TAG: ${{ github.sha }} |
| 115 | + OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell |
| 116 | + run: mise run --no-deps --skip-deps e2e:helm |
0 commit comments