Remove some duplication on chart-testing CI

Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
Marco Franssen
2023-03-09 10:09:50 -08:00
committed by kfox1111
parent b6dd136af2
commit 493ad8fbed
+7 -6
View File
@@ -152,17 +152,18 @@ jobs:
- name: Run chart-testing (install)
run: |
[ "$VALUES" != "default" ] && kubectl create namespace "$VALUES"
scenario="$(basename "${TEST_DIR}")"
[ "${scenario}" != "default" ] && kubectl create namespace "${scenario}"
post-install() {
[ -x .github/tests/$VALUES/post-install.sh ] && .github/tests/$VALUES/post-install.sh
[ -x "${TEST_DIR}/post-install.sh" ] && "${TEST_DIR}/post-install.sh"
exit $1
}
trap 'post-install $? $LINENO' EXIT
[ -x .github/tests/$VALUES/pre-install.sh ] && .github/tests/$VALUES/pre-install.sh
[ -x "${TEST_DIR}/pre-install.sh" ] && "${TEST_DIR}/pre-install.sh"
ct install --debug \
--namespace $VALUES \
--namespace "${scenario}" \
--target-branch ${{ github.base_ref }} \
--exclude-deprecated \
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=.github/tests/$VALUES/values.yaml"') || '' }}
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=${TEST_DIR}/values.yaml"') || '' }}
env:
VALUES: ${{ matrix.values }}
TEST_DIR: .github/tests/${{ matrix.values }}