|
| 1 | +name: Lint and Test Charts |
| 2 | + |
| 3 | +on: pull_request |
| 4 | + |
| 5 | +jobs: |
| 6 | + lint-test: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - name: Checkout |
| 10 | + uses: actions/checkout@v3 |
| 11 | + with: |
| 12 | + fetch-depth: 0 |
| 13 | + |
| 14 | + - name: Set up Helm |
| 15 | + uses: azure/setup-helm@v3 |
| 16 | + with: |
| 17 | + version: v3.10.0 |
| 18 | + |
| 19 | + - name: Set up Python |
| 20 | + uses: actions/setup-python@v4 |
| 21 | + with: |
| 22 | + # token: ${{ secrets.PYTHON_API_TOKEN }} |
| 23 | + python-version: "3.10" |
| 24 | + check-latest: true |
| 25 | + |
| 26 | + - name: Set up chart-testing |
| 27 | + uses: helm/chart-testing-action@v2.3.1 |
| 28 | + with: |
| 29 | + version: v3.5.1 |
| 30 | + |
| 31 | + - name: Run chart-testing (list-changed) |
| 32 | + id: list-changed |
| 33 | + run: | |
| 34 | + changed=$(ct list-changed --config ct.yaml) |
| 35 | + if [[ -n "$changed" ]]; then |
| 36 | + echo "$changed" |
| 37 | + echo "::set-output name=changed::true" |
| 38 | + fi |
| 39 | + - name: Run chart-testing (lint) |
| 40 | + run: ct lint --config ct.yaml --debug |
| 41 | + |
| 42 | + # lint-test-install: |
| 43 | + # runs-on: ubuntu-latest |
| 44 | + # strategy: |
| 45 | + # matrix: |
| 46 | + # # https://kubernetes.io/releases/ |
| 47 | + # k8s: |
| 48 | + # - v1.21.2 |
| 49 | + # - v1.22.15 |
| 50 | + # - v1.23.12 |
| 51 | + # - v1.24.6 |
| 52 | + # - v1.25.2 |
| 53 | + # steps: |
| 54 | + # - name: Checkout |
| 55 | + # uses: actions/checkout@v3 |
| 56 | + # with: |
| 57 | + # fetch-depth: 0 |
| 58 | + |
| 59 | + # - name: Set up chart-testing |
| 60 | + # uses: helm/chart-testing-action@v2.3.1 |
| 61 | + # with: |
| 62 | + # version: v3.5.1 |
| 63 | + |
| 64 | + # - name: Run chart-testing (list-changed) |
| 65 | + # id: list-changed |
| 66 | + # run: | |
| 67 | + # changed=$(ct list-changed --config ct.yaml) |
| 68 | + # if [[ -n "$changed" ]]; then |
| 69 | + # echo "$changed" |
| 70 | + # echo "::set-output name=changed::true" |
| 71 | + # fi |
| 72 | + |
| 73 | + # - name: Create kind cluster |
| 74 | + # if: steps.list-changed.outputs.changed == 'true' |
| 75 | + # uses: helm/kind-action@v1.4.0 |
| 76 | + # with: |
| 77 | + # kubectl_version: ${{ matrix.k8s }} |
| 78 | + # verbosity: 10 |
| 79 | + |
| 80 | + # - name: Run chart-testing (install) |
| 81 | + # run: ct install --config ct.yaml |
| 82 | + |
| 83 | + lint-docs: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Checkout |
| 87 | + uses: actions/checkout@v3 |
| 88 | + - name: Run helm-docs |
| 89 | + env: |
| 90 | + HELM_DOCS_VERSION: "1.11.0" |
| 91 | + run: | |
| 92 | + curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz |
| 93 | + tar -xf /tmp/helm-docs.tar.gz helm-docs |
| 94 | + ./helm-docs |
| 95 | + git diff --exit-code |
0 commit comments