Add infrastructure to test charts without defaulted values

Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
Marco Franssen
2023-02-23 10:33:28 +01:00
parent 8a3ae10da5
commit 9135086f8e
+32 -2
View File
@@ -7,6 +7,7 @@ on:
- 'charts/**' - 'charts/**'
- '.github/workflows/helm-chart-ci.yaml' - '.github/workflows/helm-chart-ci.yaml'
- '.github/kind/conf/kind-config.yaml' - '.github/kind/conf/kind-config.yaml'
- '.github/tests/**/*.yaml'
- 'helm-docs.sh' - 'helm-docs.sh'
concurrency: concurrency:
@@ -14,7 +15,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
HELM_VERSION: v3.10.2 HELM_VERSION: v3.11.0
PYTHON_VERSION: 3.11.1 PYTHON_VERSION: 3.11.1
CHART_TESTING_VERSION: v3.7.1 CHART_TESTING_VERSION: v3.7.1
@@ -69,10 +70,34 @@ jobs:
outputs: outputs:
changed: ${{ steps.list-changed.outputs.changed }} changed: ${{ steps.list-changed.outputs.changed }}
build-matrix:
name: Build matrix
runs-on: ubuntu-22.04
needs: [lint-chart]
if: needs.lint-chart.outputs.changed == 'true'
steps:
- name: Checkout
uses: actions/[email protected]
- id: set-matrix
name: Collect all tests
run: |
tests="$(echo -e "default\n$(find .github/tests -maxdepth 1 -type d | grep -Ev 'tests$' | xargs -I % basename % | sort | uniq)")"
tests_json="$(echo "$tests" | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')"
echo "tests=$tests_json" >> $GITHUB_OUTPUT
outputs:
tests: ${{ steps.set-matrix.outputs.tests }}
test: test:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: needs:
- lint-chart - lint-chart
- build-matrix
if: needs.lint-chart.outputs.changed == 'true' if: needs.lint-chart.outputs.changed == 'true'
@@ -89,6 +114,8 @@ jobs:
- v1.23.13 - v1.23.13
- v1.22.15 - v1.22.15
- v1.21.14 - v1.21.14
values:
- ${{ fromJson(needs.build-matrix.outputs.tests) }}
steps: steps:
- name: Checkout - name: Checkout
@@ -124,4 +151,7 @@ jobs:
run: | run: |
ct install --debug \ ct install --debug \
--target-branch main \ --target-branch main \
--exclude-deprecated --exclude-deprecated \
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=.github/tests/$VALUES/values.yaml"') || '' }}
env:
VALUES: ${{ matrix.values }}