fix: legacy release workflow running on >=v0.25 #6555
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: Lint and Test Prime and Community Charts | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| TAG: v0.0.1 | |
| RELEASE_TAG: v0.0.1 | |
| MANIFEST_IMG: controller | |
| CONTROLLER_IMG: controller | |
| PULL_POLICY: Never | |
| CERT_MANAGER_VERSION: v1.16.3 | |
| RANCHER_VERSION: v2.13.0-rc1 | |
| jobs: | |
| prime-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v3.14.3 | |
| - name: setupGo | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: go.mod | |
| - name: Build docker image (prime) | |
| run: make docker-build-prime | |
| - name: Package operator chart | |
| run: make release-chart | |
| - name: Run chart-testing (lint) | |
| run: make test-chart | |
| - name: Install kind | |
| run: | | |
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-$(uname)-amd64 | |
| chmod +x ./kind | |
| sudo mv ./kind /usr/local/bin/kind | |
| - name: Create kind cluster | |
| run: | | |
| kind create cluster --name kind \ | |
| --image kindest/node@sha256:abd489f042d2b644e2d033f5c2d900bc707798d075e8186cb65e3f1367a9d5a1 | |
| - name: Display kind version | |
| run: kind version | |
| - name: Display docker version | |
| run: docker version | |
| - name: Add local docker image | |
| run: kind load docker-image ${{ env.MANIFEST_IMG }}:${{ env.TAG }} | |
| - name: Add cert-manager chart repo | |
| run: helm repo add jetstack https://charts.jetstack.io | |
| - name: Add rancher chart repo | |
| run: helm repo add rancher-latest https://releases.rancher.com/server-charts/latest | |
| - name: Install cert-manager | |
| run: helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version ${{ env.CERT_MANAGER_VERSION }} --set crds.enabled=true --set crds.keep=true --wait | |
| - name: Install Rancher | |
| run: helm install rancher rancher-latest/rancher --namespace cattle-system --create-namespace --set bootstrapPassword=rancheradmin --set replicas=1 --set hostname="e2e.dev.rancher" --set 'extraEnv[0].name=CATTLE_FEATURES' --set 'extraEnv[0].value=turtles=false' --version ${{ env.RANCHER_VERSION }} --wait | |
| - name: Wait for rancher-webhook | |
| run: | | |
| kubectl --namespace cattle-system wait --for=create deployments/rancher-webhook --timeout=300s | |
| kubectl --namespace cattle-system wait --for=condition=Available deployment/rancher-webhook --timeout=300s | |
| - name: Run chart-testing (install) | |
| run: helm install rancher-turtles out/charts/rancher-turtles/ -n rancher-turtles-system --set namespace=rancher-turtles-system --create-namespace --wait --debug | |
| - name: Wait for core provider rollout | |
| run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n cattle-capi-system --timeout=10m | |
| - name: Check capi-controller-manager image | |
| run: | | |
| IMAGE=$(kubectl get deployment capi-controller-manager -n cattle-capi-system -o jsonpath='{.spec.template.spec.containers[0].image}') | |
| if [[ "$IMAGE" != registry.suse.com/rancher/cluster-api-controller* ]]; then | |
| echo "capi-controller-manager does not use registry.suse.com/rancher/cluster-api-controller based image" | |
| exit 1 | |
| fi | |
| - name: Run chart-testing (un-install) | |
| run: helm uninstall rancher-turtles -n rancher-turtles-system --cascade foreground --wait --debug --timeout=10m | |
| - name: Run chart re-install | |
| run: helm install rancher-turtles out/charts/rancher-turtles/ -n rancher-turtles-system --set namespace=rancher-turtles-system --create-namespace --wait --debug | |
| community-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v3.14.3 | |
| - name: setupGo | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: go.mod | |
| - name: Build community docker image | |
| run: make docker-build-community TAG=${{ env.TAG }} | |
| - name: Package operator chart | |
| run: make release-chart | |
| - name: Install kind | |
| run: | | |
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-$(uname)-amd64 | |
| chmod +x ./kind | |
| sudo mv ./kind /usr/local/bin/kind | |
| - name: Create kind cluster | |
| run: | | |
| kind create cluster --name kind \ | |
| --image kindest/node@sha256:abd489f042d2b644e2d033f5c2d900bc707798d075e8186cb65e3f1367a9d5a1 | |
| - name: Display kind version | |
| run: kind version | |
| - name: Display docker version | |
| run: docker version | |
| - name: Add local docker image | |
| run: kind load docker-image ${{ env.MANIFEST_IMG }}:${{ env.TAG }} | |
| - name: Install cert-manager | |
| run: helm repo add jetstack https://charts.jetstack.io && helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version ${{ env.CERT_MANAGER_VERSION }} --set crds.enabled=true --set crds.keep=true --wait | |
| - name: Install Rancher | |
| run: helm repo add rancher-latest https://releases.rancher.com/server-charts/latest && helm install rancher rancher-latest/rancher --namespace cattle-system --create-namespace --set bootstrapPassword=rancheradmin --set replicas=1 --set hostname="e2e.dev.rancher" --set 'extraEnv[0].name=CATTLE_FEATURES' --set 'extraEnv[0].value=turtles=false' --version ${{ env.RANCHER_VERSION }} --wait | |
| - name: Wait for rancher-webhook | |
| run: | | |
| kubectl --namespace cattle-system wait --for=create deployments/rancher-webhook --timeout=300s | |
| kubectl --namespace cattle-system wait --for=condition=Available deployment/rancher-webhook --timeout=300s | |
| - name: Install rancher-turtles chart | |
| run: helm install rancher-turtles out/charts/rancher-turtles/ -n rancher-turtles-system --set namespace=rancher-turtles-system --create-namespace --wait --debug | |
| - name: Wait for core provider rollout | |
| run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n cattle-capi-system --timeout=10m | |
| - name: Check capi-controller-manager image is from kubernetes-sigs (community) | |
| run: | | |
| IMAGE=$(kubectl get deployment capi-controller-manager -n cattle-capi-system -o jsonpath='{.spec.template.spec.containers[0].image}') | |
| if [[ "$IMAGE" != registry.k8s.io/cluster-api/cluster-api-controller* ]]; then | |
| echo "capi-controller-manager does not use registry.k8s.io/cluster-api/cluster-api-controller based image" | |
| exit 1 | |
| fi |