name: Lint and Test Charts

on: pull_request

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Fetch history
        run: git fetch --prune --unshallow

      - name: Run chart-testing (lint)
        uses: helm/chart-testing-action@v1.0.0-rc.2
        with:
          config: .github/ct-lint.yaml
          command: lint
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Fetch history
        run: git fetch --prune --unshallow

      - name: Create kind cluster
        uses: helm/kind-action@v1.0.0-rc.1

      - name: Run chart-testing (install)
        uses: helm/chart-testing-action@v1.0.0-rc.2
        with:
          config: .github/ct-install.yaml
          command: install
  check-categories:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Fetch history
        run: git fetch --prune --unshallow

      - name: Check categories
        uses: bitnami/chart-categories-action@master
