name: Lint and Test Charts on: pull_request jobs: lint-test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Install Helm uses: azure/setup-helm@v1 with: version: v3.4.0 - uses: actions/setup-python@v2 with: python-version: 3.7 - name: Set up chart-testing uses: helm/chart-testing-action@v2.0.1 - name: Run chart-testing (list-changed) id: list-changed run: | changed=$(ct list-changed --config .github/ct.yaml) if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" fi changed_unfiltered=$(ct list-changed --config .github/ct.yaml --excluded-charts "") if [[ $(grep -E "^charts/common(-test)?$" <<< "$changed_unfiltered") ]]; then echo "::set-output name=common::true" fi - name: Run chart-testing (lint) id: lint run: ct lint --config .github/ct.yaml --excluded-charts "" if: steps.list-changed.outputs.common == 'true' || steps.list-changed.outputs.common == 'true' - name: Create kind cluster uses: helm/kind-action@v1.1.0 if: steps.list-changed.outputs.changed == 'true' || steps.list-changed.outputs.common == 'true' - name: Run chart-testing (install) run: ct install --config .github/ct.yaml if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (common-test) run: | ct install --config .github/ct.yaml --charts 'charts/common-test' if: steps.list-changed.outputs.common == 'true'