|
38 | 38 | name: "Check helm chart lint"
|
39 | 39 | runs-on: ubuntu-20.04
|
40 | 40 | 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 }} |
42 | 42 | steps:
|
43 | 43 | - uses: actions/checkout@v4
|
44 | 44 | with:
|
|
57 | 57 | - name: Check for changes in helm output for default values
|
58 | 58 | working-directory: .
|
59 | 59 | run: |
|
60 |
| - helm template helm/hpcc > ${{ runner.temp }}/newoutput.txt |
61 |
| - git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ${{ github.base_ref }} |
| 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 | +
|
| 73 | + git fetch --no-tags --prune --progress --no-recurse-submodules --quiet --depth=1 origin ${{ github.base_ref }} |
62 | 74 | 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 | + echo old |
| 99 | + grep "my-dali-plane" ${{ runner.temp }}/old/$tail.txt | cat |
| 100 | + echo new |
| 101 | + grep "my-dali-plane" ${{ runner.temp }}/new/$tail.txt | cat |
| 102 | + done |
| 103 | + fi |
| 104 | +
|
| 105 | + exit $resultcode |
0 commit comments