Skip to content

Commit 0743b04

Browse files
committed
Improve helm checking
Signed-off-by: Gavin Halliday <[email protected]>
1 parent bb52776 commit 0743b04

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

.github/workflows/test-helm.yml

+37-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,42 @@ jobs:
5757
- name: Check for changes in helm output for default values
5858
working-directory: .
5959
run: |
60-
helm template helm/hpcc > ${{ runner.temp }}/newoutput.txt
60+
resultcode=0
61+
mkdir ${{ runner.temp }}/new
62+
mkdir ${{ runner.temp }}/old
63+
64+
#Generate the output for the default values file, and each of the specialised test files.
65+
#Check to see if anything has changed between old and new, and report the differences
66+
helm template helm/hpcc > ${{ runner.temp }}/new/output.txt
67+
for file in testing/helm/tests/*.yaml
68+
do
69+
helm template helm/hpcc --values $file > ${{ runner.temp }}/new/$file.txt
70+
done
71+
6172
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ${{ github.base_ref }}
6273
git checkout ${{ github.base_ref }}
63-
helm template helm/hpcc > ${{ runner.temp }}/oldoutput.txt
64-
diff ${{ runner.temp }}/oldoutput.txt ${{ runner.temp }}/newoutput.txt
74+
75+
helm template helm/hpcc > ${{ runner.temp }}/old/output.txt
76+
for file in testing/helm/tests/*.yaml
77+
do
78+
helm template helm/hpcc --values $file > ${{ runner.temp }}/old/$file.txt
79+
done
80+
81+
diff ${{ runner.temp }}/old/output.txt ${{ runner.temp }}/new/output.txt
82+
if [ $? -ne 0 ]
83+
then
84+
resultcode=1
85+
else
86+
#Only check for differences in the specialised test files if the default values file is the same
87+
for file in testing/helm/tests/*.yaml
88+
do
89+
echo Check $file
90+
diff ${{ runner.temp }}/old/$file.txt ${{ runner.temp }}/new/$file.txt
91+
if [ $? -ne 0 ]
92+
then
93+
resultcode=1
94+
fi
95+
done
96+
fi
97+
98+
exit $resultcode

0 commit comments

Comments
 (0)