|
| 1 | +name: Helm Testdata Sample |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'testdata/project-v4-with-plugins/**' |
| 7 | + - '.github/workflows/test-helm-samples.yml' |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - 'testdata/project-v4-with-plugins/**' |
| 11 | + - '.github/workflows/test-helm-samples.yml' |
| 12 | + |
| 13 | +jobs: |
| 14 | + helm-test-project-v4-with-plugins: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + fail-fast: true |
| 18 | + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Setup Go |
| 24 | + uses: actions/setup-go@v5 |
| 25 | + with: |
| 26 | + go-version: '~1.22' |
| 27 | + |
| 28 | + - name: Install the latest version of kind |
| 29 | + run: | |
| 30 | + curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 |
| 31 | + chmod +x ./kind |
| 32 | + sudo mv ./kind /usr/local/bin/kind |
| 33 | +
|
| 34 | + - name: Verify kind installation |
| 35 | + run: kind version |
| 36 | + |
| 37 | + - name: Create kind cluster |
| 38 | + run: kind create cluster |
| 39 | + |
| 40 | + - name: Prepare project-v4-with-plugins |
| 41 | + run: | |
| 42 | + cd testdata/project-v4-with-plugins/ |
| 43 | + go mod tidy |
| 44 | + make docker-build IMG=project-v4-with-plugins:v0.1.0 |
| 45 | + kind load docker-image project-v4-with-plugins:v0.1.0 |
| 46 | +
|
| 47 | + - name: Install Helm |
| 48 | + run: | |
| 49 | + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash |
| 50 | +
|
| 51 | + - name: Verify Helm installation |
| 52 | + run: helm version |
| 53 | + |
| 54 | + - name: Lint Helm chart for project-v4-with-plugins |
| 55 | + run: | |
| 56 | + helm lint testdata/project-v4-with-plugins/dist/chart |
| 57 | +
|
| 58 | + - name: Install cert-manager via Helm |
| 59 | + run: | |
| 60 | + helm repo add jetstack https://charts.jetstack.io |
| 61 | + helm repo update |
| 62 | + helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true |
| 63 | +
|
| 64 | + - name: Wait for cert-manager to be ready |
| 65 | + run: | |
| 66 | + kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager |
| 67 | + kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-cainjector |
| 68 | + kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-webhook |
| 69 | +
|
| 70 | + - name: Install Helm chart for project-v4-with-plugins |
| 71 | + run: | |
| 72 | + helm install my-release testdata/project-v4-with-plugins/dist/chart --create-namespace --namespace project-v4-with-plugins-system |
| 73 | +
|
| 74 | + - name: Check Helm release status |
| 75 | + run: | |
| 76 | + helm status my-release --namespace project-v4-with-plugins-system |
0 commit comments