|
1 | 1 | name: Run helm chart tests
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - "master" |
7 |
| - - "candidate-*" |
8 |
| - - "!candidate-7.8.*" |
9 |
| - - "!candidate-7.6.*" |
10 |
| - - "!candidate-7.4.*" |
11 |
| - - "!candidate-7.2.*" |
12 |
| - - "!candidate-7.0.*" |
13 |
| - - "!candidate-6.*" |
14 | 4 | pull_request:
|
15 | 5 | branches:
|
16 | 6 | - "master"
|
|
38 | 28 | name: "Check helm chart lint"
|
39 | 29 | runs-on: ubuntu-20.04
|
40 | 30 | needs: pre_job
|
41 |
| - if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }} |
| 31 | + #if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }} |
42 | 32 | steps:
|
43 | 33 | - uses: actions/checkout@v4
|
44 | 34 | with:
|
|
57 | 47 | - name: Check for changes in helm output for default values
|
58 | 48 | working-directory: .
|
59 | 49 | 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 }} |
| 50 | + resultcode=0 |
| 51 | + mkdir ${{ runner.temp }}/new |
| 52 | + mkdir ${{ runner.temp }}/old |
| 53 | +
|
| 54 | + #Generate the output for the default values file, and each of the specialised test files. |
| 55 | + #Check to see if anything has changed between old and new, and report the differences |
| 56 | + helm template helm/hpcc > ${{ runner.temp }}/new/output.txt |
| 57 | + for file in testing/helm/tests/*.yaml |
| 58 | + do |
| 59 | + tail=$(basename $file) |
| 60 | + helm template helm/hpcc --values $file > ${{ runner.temp }}/new/$tail.txt |
| 61 | + done |
| 62 | +
|
| 63 | + git fetch --no-tags --prune --progress --no-recurse-submodules --quiet --depth=1 origin ${{ github.base_ref }} |
| 64 | + echo git checkout ${{ github.base_ref }} |
62 | 65 | git checkout ${{ github.base_ref }}
|
63 |
| - helm template helm/hpcc > ${{ runner.temp }}/oldoutput.txt |
64 |
| - diff ${{ runner.temp }}/oldoutput.txt ${{ runner.temp }}/newoutput.txt |
| 66 | +
|
| 67 | + helm template helm/hpcc > ${{ runner.temp }}/old/output.txt |
| 68 | + for file in testing/helm/tests/*.yaml |
| 69 | + do |
| 70 | + tail=$(basename $file) |
| 71 | + helm template helm/hpcc --values $file > ${{ runner.temp }}/old/$tail.txt |
| 72 | + done |
| 73 | +
|
| 74 | + diff ${{ runner.temp }}/old/output.txt ${{ runner.temp }}/new/output.txt |
| 75 | + if [ $? -ne 0 ] |
| 76 | + then |
| 77 | + resultcode=1 |
| 78 | + else |
| 79 | + #Only check for differences in the specialised test files if the default values file is the same |
| 80 | + for file in testing/helm/tests/*.yaml |
| 81 | + do |
| 82 | + tail=$(basename $file) |
| 83 | + echo Check $tail |
| 84 | + diff ${{ runner.temp }}/old/$tail.txt ${{ runner.temp }}/new/$tail.txt |
| 85 | + if [ $? -ne 0 ] |
| 86 | + then |
| 87 | + resultcode=1 |
| 88 | + fi |
| 89 | + echo old |
| 90 | + grep "my-dali-plane" ${{ runner.temp }}/old/$tail.txt | cat |
| 91 | + echo new |
| 92 | + grep "my-dali-plane" ${{ runner.temp }}/new/$tail.txt | cat |
| 93 | + done |
| 94 | + fi |
| 95 | +
|
| 96 | + exit $resultcode |
0 commit comments