Skip to content

Chore(charts): Unit tests for wardend. Updated pipelines, docs #116

Chore(charts): Unit tests for wardend. Updated pipelines, docs

Chore(charts): Unit tests for wardend. Updated pipelines, docs #116

Workflow file for this run

name: charts/all
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch default branch
run: git fetch origin ${{ github.event.repository.default_branch }}:${{ github.event.repository.default_branch }}
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: "v3.16.3"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
with:
version: "v3.11.0"
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: >
ct lint
--config ct.yaml
--target-branch ${{ github.event.repository.default_branch }}
- name: Install helm unittest plugin
if: steps.list-changed.outputs.changed == 'true'
run: |
helm env
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version 0.7.0
- name: Run helm unittest on changed charts
if: env.changed != ''
run: |
for chart in $changed; do
echo "Running helm unittest for $chart"
helm unittest -f "$chart/tests/unit/*_test.yaml" "$chart"
done