Skip to content

Commit 598c5e2

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

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

.github/workflows/test-helm.yml

+41-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
name: "Check helm chart lint"
3939
runs-on: ubuntu-20.04
4040
needs: pre_job
41-
if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }}
41+
#if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }}
4242
steps:
4343
- uses: actions/checkout@v4
4444
with:
@@ -57,8 +57,45 @@ 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+
tail=$(basename $file)
70+
helm template helm/hpcc --values $file > ${{ runner.temp }}/new/$tail.txt
71+
done
72+
6173
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ${{ github.base_ref }}
6274
git checkout ${{ github.base_ref }}
63-
helm template helm/hpcc > ${{ runner.temp }}/oldoutput.txt
64-
diff ${{ runner.temp }}/oldoutput.txt ${{ runner.temp }}/newoutput.txt
75+
76+
helm template helm/hpcc > ${{ runner.temp }}/old/output.txt
77+
for file in testing/helm/tests/*.yaml
78+
do
79+
tail=$(basename $file)
80+
helm template helm/hpcc --values $file > ${{ runner.temp }}/old/$tail.txt
81+
done
82+
83+
diff ${{ runner.temp }}/old/output.txt ${{ runner.temp }}/new/output.txt
84+
if [ $? -ne 0 ]
85+
then
86+
resultcode=1
87+
else
88+
#Only check for differences in the specialised test files if the default values file is the same
89+
for file in testing/helm/tests/*.yaml
90+
do
91+
tail=$(basename $file)
92+
echo Check $tail
93+
diff ${{ runner.temp }}/old/$tail.txt ${{ runner.temp }}/new/$tail.txt
94+
if [ $? -ne 0 ]
95+
then
96+
resultcode=1
97+
fi
98+
done
99+
fi
100+
101+
exit $resultcode

0 commit comments

Comments
 (0)