Skip to content

Commit 5d89ba6

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

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.github/workflows/test-helm.yml

+38-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,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)