Formatting updates, prep for improved testing #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test Charts | |
on: pull_request | |
jobs: | |
lint-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- name: Install helm-unittest plugin | |
run: helm plugin install https://github.com/helm-unittest/helm-unittest | |
- name: Install chart-testing | |
uses: helm/[email protected] | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed) | |
if [[ -n "$changed" ]]; then | |
echo "::set-output name=changed::true" | |
fi | |
- name: Run chart-testing (lint) | |
run: ct lint | |
- name: Get changed charts | |
id: changed-charts | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
base_ref=${{ github.base_ref }} | |
else | |
base_ref=$(git rev-parse HEAD^) | |
fi | |
changed_charts=$(git diff --find-renames --name-only $base_ref -- charts | grep Chart.yaml | xargs -L1 dirname | sort -u) | |
echo "Changed charts: $changed_charts" | |
echo "changed_charts=$changed_charts" >> $GITHUB_OUTPUT | |
- name: Create kind cluster | |
uses: helm/[email protected] | |
if: steps.list-changed.outputs.changed == 'true' | |
- name: Run chart-testing (install) | |
run: ct install |