blob: 9ba0d4fcd791532ea3763c0b97183445088a89da [file] [log] [blame]
name: Lint and Test Charts
on:
push:
branches:
- main
pull_request:
permissions:
checks: write
contents: read
statuses: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
submodules: recursive
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.6.3
- name: Set up chart-testing
uses: ./.github/actions/chart-testing-action
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main --chart-dirs .)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint changed)
if: ${{ github.ref != 'refs/heads/main' }}
run: ct lint --target-branch main --chart-dirs .
- name: Run chart-testing (lint all)
if: ${{ github.ref == 'refs/heads/main' }}
run: ct lint --target-branch main --all --chart-dirs .
install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
submodules: recursive
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.6.3
- name: Set up chart-testing
uses: ./.github/actions/chart-testing-action
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main --chart-dirs .)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create kind cluster
uses: ./.github/actions/kind-action
if: ( steps.list-changed.outputs.changed == 'true' ) || ${{ github.ref == 'refs/heads/main' }}
- name: Run chart-testing (install changed)
if: ${{ github.ref != 'refs/heads/main' }}
run: ct install --target-branch main --chart-dirs --upgrade .
- name: Run chart-testing (install all)
if: ${{ github.ref == 'refs/heads/main' }}
run: ct install --target-branch main --all --chart-dirs --upgrade .