|
| 1 | +--- |
| 2 | +name: Helm lint and test |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint-test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v5 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + - name: Set up Helm |
| 19 | + uses: azure/setup-helm@v4.2.0 |
| 20 | + with: |
| 21 | + version: v3.17.0 |
| 22 | + |
| 23 | + - uses: actions/setup-python@v5.3.0 |
| 24 | + with: |
| 25 | + python-version: "3.x" |
| 26 | + check-latest: true |
| 27 | + |
| 28 | + - name: Run helm-docs |
| 29 | + uses: losisin/helm-docs-github-action@v1 |
| 30 | + with: |
| 31 | + fail-on-diff: true |
| 32 | + |
| 33 | + - name: Set up chart-testing |
| 34 | + uses: helm/chart-testing-action@v2.7.0 |
| 35 | + with: |
| 36 | + version: 3.14.0 |
| 37 | + yamllint_version: 1.37.1 |
| 38 | + yamale_version: 6.0.0 |
| 39 | + |
| 40 | + - name: Set up helm repos |
| 41 | + run: | |
| 42 | + helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/ |
| 43 | +
|
| 44 | + - name: Run chart-testing (list-changed) |
| 45 | + id: list-changed |
| 46 | + run: | |
| 47 | + changed=$(ct list-changed --chart-dirs kubernetes/chart --target-branch ${{ github.event.repository.default_branch }}) |
| 48 | + if [[ -n "$changed" ]]; then |
| 49 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 50 | + fi |
| 51 | +
|
| 52 | + - name: Run chart-testing (lint) |
| 53 | + if: steps.list-changed.outputs.changed == 'true' |
| 54 | + run: ct lint --chart-dirs kubernetes/chart --target-branch ${{ github.event.repository.default_branch }} --lint-conf lintconf.yaml --github-groups |
| 55 | + |
| 56 | + - name: Create kind cluster |
| 57 | + if: steps.list-changed.outputs.changed == 'true' |
| 58 | + uses: helm/kind-action@v1 |
| 59 | + |
| 60 | + - name: Run chart-testing (install) |
| 61 | + id: chart-testing-install |
| 62 | + if: steps.list-changed.outputs.changed == 'true' |
| 63 | + run: ct install --chart-dirs kubernetes/chart --target-branch ${{ github.event.repository.default_branch }} --github-groups --skip-clean-up |
| 64 | + |
| 65 | + - name: Fetch logs |
| 66 | + if: always() |
| 67 | + run: | |
| 68 | + namespace=$(helm list --all-namespaces --output json \ |
| 69 | + | jq -r '[.[] | select(.namespace | startswith("zulip-"))][0].namespace') |
| 70 | + pod=$(kubectl get pods -n "$namespace" -l app.kubernetes.io/name=zulip --output name) |
| 71 | + kubectl -n "$namespace" exec -it "$pod" -c zulip -- cat /var/log/zulip/errors.log |
0 commit comments