|
| 1 | +name: helm-charts |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: {} |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} |
| 9 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 10 | +jobs: |
| 11 | + verify: |
| 12 | + runs-on: ubuntu-24.04 |
| 13 | + timeout-minutes: 5 |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - name: Get changed files |
| 17 | + id: changed-files |
| 18 | + uses: tj-actions/changed-files@480f49412651059a414a6a5c96887abb1877de8a # v45.0.7 |
| 19 | + with: |
| 20 | + files: | |
| 21 | + .github/workflows/helm-charts.yml |
| 22 | + tools/sync-to-public-repo.py |
| 23 | + public-repos/helm-charts/** |
| 24 | + helm/** |
| 25 | + - name: List modified files |
| 26 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 27 | + run: | |
| 28 | + echo "One or more files have changed: ${{ steps.changed-files.outputs.all_changed_files }}" |
| 29 | + - name: KubeConform manifests cache |
| 30 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 31 | + uses: actions/cache@v4 |
| 32 | + with: |
| 33 | + path: ~/.cache/kubeconform |
| 34 | + key: ${{ runner.os }}-kubeconform-v0 |
| 35 | + - name: Check yq version |
| 36 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 37 | + # yq is included in GHA, so just log the version |
| 38 | + run: yq --version |
| 39 | + - name: Install KubeConform |
| 40 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 41 | + # https://github.com/yannh/kubeconform/releases/tag/v0.6.7 |
| 42 | + run: | |
| 43 | + VERSION="0.6.7" |
| 44 | + FILENAME="kubeconform-linux-amd64.tar.gz" |
| 45 | + URL="https://github.com/yannh/kubeconform/releases/download/v${VERSION}/${FILENAME}" |
| 46 | + curl -L -o "${FILENAME}" "${URL}" |
| 47 | + tar xzf "${FILENAME}" && chmod +x kubeconform |
| 48 | + sudo mv kubeconform /usr/local/bin/ |
| 49 | + kubeconform -v |
| 50 | + - name: Verify Helm Charts |
| 51 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 52 | + run: | |
| 53 | + ./helm/test-charts.sh |
| 54 | + outputs: |
| 55 | + files_changed: ${{ steps.changed-files.outputs.any_changed }} |
0 commit comments