|
1 | 1 | name: Lint and Test Charts |
| 2 | +permissions: {} |
2 | 3 |
|
3 | | -on: pull_request |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - main |
4 | 8 |
|
5 | 9 | jobs: |
6 | 10 | lint-test: |
7 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
8 | 14 | strategy: |
9 | 15 | matrix: |
10 | | - k8s: |
11 | | - - v1.30.13 |
12 | | - - v1.31.9 |
13 | | - - v1.32.5 |
14 | | - # # renovate: image=docker.io/kindest/node |
15 | | - - v1.33.2 |
| 16 | + k8s-version: |
| 17 | + - "kindest/node:v1.31.12" |
| 18 | + - "kindest/node:v1.32.8" |
| 19 | + - "kindest/node:v1.33.4" |
| 20 | + - "kindest/node:v1.34.0" |
16 | 21 | steps: |
17 | 22 | - name: Checkout |
18 | | - uses: actions/checkout@v5 |
| 23 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
19 | 24 | with: |
20 | 25 | fetch-depth: 0 |
21 | 26 |
|
22 | 27 | - name: Set up Helm |
23 | | - uses: azure/setup-helm@v4 |
| 28 | + uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 |
24 | 29 | with: |
25 | | - version: v3.9.4 |
| 30 | + # renovate: github=helm/helm |
| 31 | + version: v3.19.0 |
26 | 32 |
|
27 | | - - uses: actions/setup-python@v6 |
| 33 | + - name: Set up Python |
| 34 | + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 |
28 | 35 | with: |
29 | | - python-version: 3.14.0 |
| 36 | + python-version: '3.13' |
30 | 37 |
|
31 | 38 | - name: Set up chart-testing |
32 | | - uses: helm/chart-testing-action@v2.8.0 |
| 39 | + uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 |
| 40 | + with: |
| 41 | + # renovate: github=helm/chart-testing |
| 42 | + version: v3.14.0 |
33 | 43 |
|
34 | 44 | - name: Run chart-testing (list-changed) |
35 | 45 | id: list-changed |
36 | 46 | run: | |
37 | | - changed=$(ct list-changed --config .github/ct.yaml) |
| 47 | + changed=$(ct list-changed --config .github/linters/ct.yaml) |
38 | 48 | if [[ -n "$changed" ]]; then |
39 | | - echo "changed=true" >> $GITHUB_OUTPUT |
| 49 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 50 | + echo "changed_list=\"${changed//$'\n'/ }\"" >> "$GITHUB_OUTPUT" |
40 | 51 | fi |
41 | 52 |
|
42 | 53 | - name: Run chart-testing (lint) |
43 | | - run: ct lint --config .github/ct.yaml |
| 54 | + run: ct lint --config .github/linters/ct.yaml |
44 | 55 |
|
45 | 56 | - name: Create kind cluster |
46 | | - uses: helm/kind-action@v1.13.0 |
47 | | - with: |
48 | | - node_image: "kindest/node:${{ matrix.k8s }}" |
| 57 | + uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0 |
49 | 58 | if: steps.list-changed.outputs.changed == 'true' |
| 59 | + with: |
| 60 | + node_image: ${{ matrix.k8s-version }} |
50 | 61 |
|
51 | 62 | - name: Apply Gateway API CRDs |
52 | 63 | run: | |
53 | 64 | kubectl apply -k https://github.com/kubernetes-sigs/gateway-api/config/crd |
54 | 65 | if: steps.list-changed.outputs.changed == 'true' |
55 | 66 |
|
56 | | - - name: Install Zalando's postgres-operator |
| 67 | + - name: Apply Prometheus Operator CRDs |
| 68 | + env: |
| 69 | + CHANGED_LIST: ${{ steps.list-changed.outputs.changed_list }} |
57 | 70 | run: | |
58 | | - helm install postgres-operator postgres-operator-charts/postgres-operator |
| 71 | + helm install prometheus-operator-crds oci://ghcr.io/prometheus-community/charts/prometheus-operator-crds |
59 | 72 | if: steps.list-changed.outputs.changed == 'true' |
60 | 73 |
|
61 | | - - name: Install CNPG |
62 | | - run: | |
63 | | - helm install --atomic --namespace cnpg-system --create-namespace --repo https://cloudnative-pg.github.io/charts cnpg cloudnative-pg |
64 | | - if: steps.list-changed.outputs.changed == 'true' |
| 74 | + - name: Run chart-testing (install) |
| 75 | + run: ct install --config .github/linters/ct.yaml |
65 | 76 |
|
66 | | - - name: Install prometheus-operator-crds |
67 | | - run: | |
68 | | - helm install --repo https://prometheus-community.github.io/helm-charts prometheus-operator-crds prometheus-operator-crds |
69 | | - if: steps.list-changed.outputs.changed == 'true' |
| 77 | + super-linter: |
| 78 | + name: Lint Code Base |
| 79 | + runs-on: ubuntu-latest |
| 80 | + permissions: |
| 81 | + contents: read |
| 82 | + steps: |
| 83 | + - name: Checkout Code |
| 84 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 85 | + with: |
| 86 | + fetch-depth: 0 |
70 | 87 |
|
71 | | - - name: Run chart-testing (install) |
72 | | - run: ct install --config .github/ct.yaml |
| 88 | + - name: Lint Code Base |
| 89 | + uses: super-linter/super-linter/slim@2bdd90ed3262e023ac84bf8fe35dc480721fc1f2 # v8.2.1 |
| 90 | + env: |
| 91 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + LINTER_RULES_PATH: .github/linters |
| 93 | + ENABLE_COMMITLINT_STRICT_MODE: true |
| 94 | + ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true |
| 95 | + MULTI_STATUS: false |
| 96 | + VALIDATE_ALL_CODEBASE: false |
| 97 | + VALIDATE_BASH: true |
| 98 | + VALIDATE_BASH_EXEC: true |
| 99 | + # VALIDATE_CHECKOV: true - always scans everything and all charts have too much errors |
| 100 | + VALIDATE_EDITORCONFIG: true |
| 101 | + VALIDATE_ENV: true |
| 102 | + VALIDATE_GITHUB_ACTIONS: true |
| 103 | + VALIDATE_GITLEAKS: true |
| 104 | + VALIDATE_JSON: true |
| 105 | + VALIDATE_MARKDOWN: true |
| 106 | + VALIDATE_NATURAL_LANGUAGE: true |
| 107 | + VALIDATE_PYTHON: true |
| 108 | + VALIDATE_RENOVATE: true |
| 109 | + VALIDATE_SHELL_SHFMT: true |
| 110 | + VALIDATE_XML: true |
0 commit comments