Update common-tests.yaml
Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
@@ -3,18 +3,19 @@ name: Common Library Tests
|
|||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
on:
|
on:
|
||||||
|
workflow_call:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- master
|
||||||
paths:
|
paths:
|
||||||
- "charts/charts/library/common/**"
|
- "charts/library/common/**"
|
||||||
- ".github/workflows/common-tests.yaml"
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- "charts/charts/library/common/**"
|
|
||||||
- ".github/workflows/common-tests.yaml"
|
- ".github/workflows/common-tests.yaml"
|
||||||
|
#pull_request:
|
||||||
|
# branches:
|
||||||
|
# - main
|
||||||
|
# paths:
|
||||||
|
# - "charts/charts/library/common/**"
|
||||||
|
# - ".github/workflows/common-tests.yaml"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -49,7 +50,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ct lint --config .github/ct-lint.yaml \
|
ct lint --config .github/ct-lint.yaml \
|
||||||
--lint-conf .github/lint-conf.yaml \
|
--lint-conf .github/lint-conf.yaml \
|
||||||
--charts charts/library/common-test \
|
--charts charts/library/common/common-test \
|
||||||
--debug
|
--debug
|
||||||
|
|
||||||
unittest:
|
unittest:
|
||||||
@@ -91,7 +92,7 @@ jobs:
|
|||||||
(helm unittest -h > /dev/null) || helm plugin install https://github.com/helm-unittest/helm-unittest --version v${helmUnitVersion} || (sleep 10 && helm plugin install https://github.com/helm-unittest/helm-unittest --version v${helmUnitVersion}) || echo "finished unittest reinstall tries"
|
(helm unittest -h > /dev/null) || helm plugin install https://github.com/helm-unittest/helm-unittest --version v${helmUnitVersion} || (sleep 10 && helm plugin install https://github.com/helm-unittest/helm-unittest --version v${helmUnitVersion}) || echo "finished unittest reinstall tries"
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
cd charts/library/common-test/
|
cd charts/library/common/common-test/
|
||||||
helm dependency update
|
helm dependency update
|
||||||
helm unittest -f "tests/**/*.yaml" . -v ./unit-values.yaml
|
helm unittest -f "tests/**/*.yaml" . -v ./unit-values.yaml
|
||||||
|
|
||||||
@@ -224,17 +225,17 @@ jobs:
|
|||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
run: |
|
run: |
|
||||||
# Move all ci values on a temp location (or skip if already moved from another matrix job)
|
# Move all ci values on a temp location (or skip if already moved from another matrix job)
|
||||||
mv charts/library/common-test/ci charts/library/common-test/runtests || echo "Nothing to move"
|
mv charts/library/common/common-test/ci charts/library/common/common-test/runtests || echo "Nothing to move"
|
||||||
|
|
||||||
# Move one values.yaml to the correct location to run the test
|
# Move one values.yaml to the correct location to run the test
|
||||||
mv -f charts/library/common-test/runtests/${{ matrix.values }} charts/library/common-test/values.yaml
|
mv -f charts/library/common/common-test/runtests/${{ matrix.values }} charts/library/common/common-test/values.yaml
|
||||||
|
|
||||||
# Stat kail on the background to grab logs from tests
|
# Stat kail on the background to grab logs from tests
|
||||||
./kail --ignore-ns kube-system --ignore-ns cert-manager --ignore-ns metallb-system --ignore-ns prometheus-operator >> /tmp/output.log &
|
./kail --ignore-ns kube-system --ignore-ns cert-manager --ignore-ns metallb-system --ignore-ns prometheus-operator >> /tmp/output.log &
|
||||||
|
|
||||||
# Actually run the test
|
# Actually run the test
|
||||||
ct install --config .github/ct-install.yaml \
|
ct install --config .github/ct-install.yaml \
|
||||||
--charts charts/library/common-test \
|
--charts charts/library/common/common-test \
|
||||||
--debug || (echo -e "\n\n--===PODLOGS===--\n\n" && \
|
--debug || (echo -e "\n\n--===PODLOGS===--\n\n" && \
|
||||||
cat /tmp/output.log && \
|
cat /tmp/output.log && \
|
||||||
rm -f /tmp/output.log && exit 1)
|
rm -f /tmp/output.log && exit 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user