Skip to content

Commit 589a6ff

Browse files
authored
feat(ci test): add testing for helm chart (#622)
feat: add lint-test-chart job to CI Signed-off-by: Philipp Born <[email protected]> Signed-off-by: Philipp Born <[email protected]>
1 parent cee5af1 commit 589a6ff

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.ct.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://github.com/helm/chart-testing#configuration
2+
remote: origin
3+
target-branch: main
4+
chart-dirs:
5+
- contrib/charts
6+
helm-extra-args: --debug --timeout 60s
7+
check-version-increment: false
8+
validate-maintainers: false

.github/workflows/ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,49 @@ jobs:
8080
GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY
8181
./dragonfly_test --mem_defrag_threshold=0.05 # trying to catch issue with defrag
8282
# GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1 CTEST_OUTPUT_ON_FAILURE=1 ninja server/test
83+
lint-test-chart:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v2
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Set up Helm
92+
uses: azure/setup-helm@v3
93+
94+
- uses: actions/setup-python@v4
95+
with:
96+
python-version: '3.9'
97+
check-latest: true
98+
99+
- name: Set up chart-testing
100+
uses: helm/[email protected]
101+
102+
- name: Run chart-testing (list-changed)
103+
id: list-changed
104+
run: |
105+
changed=$(ct list-changed --config .ct.yaml)
106+
if [[ -n "$changed" ]]; then
107+
echo "::set-output name=changed::true"
108+
fi
109+
110+
- name: Run chart-testing (lint)
111+
run: |
112+
ct \
113+
lint \
114+
--config .ct.yaml \
115+
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
116+
117+
- if: steps.list-changed.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
118+
name: Create kind cluster
119+
uses: helm/[email protected]
120+
121+
- name: Run chart-testing (install)
122+
run: |
123+
ct \
124+
install \
125+
--config .ct.yaml \
126+
--debug \
127+
--helm-extra-set-args "--set=image.repository=ghcr.io/${{ github.repository }}" \
128+
${{github.event_name == 'workflow_dispatch' && '--all'}} ;

0 commit comments

Comments
 (0)