Skip to content

Commit bb67a5c

Browse files
refactor(ci): general updates about linting
Signed-off-by: Sebastian Gaiser <sebastian.gaiser@hetzner-cloud.de>
1 parent f59614c commit bb67a5c

21 files changed

+141
-185
lines changed

.github/ct.yaml renamed to .github/linters/ct.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ chart-dirs:
66
chart-repos:
77
- postgres-operator-charts=https://opensource.zalando.com/postgres-operator/charts/postgres-operator
88
helm-extra-args: --timeout 600s
9+
use-helmignore: true
10+
validate-maintainers: false

.github/renovate.json5

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,12 @@
44
commitBody: 'Signed-off-by: Sebastian Gaiser <sebastiangaiser@users.noreply.github.com>',
55
extends: [
66
'config:recommended',
7-
'customManagers:helmChartYamlAppVersions',
7+
'github>prometheus-community/helm-charts//renovate.json',
88
'github>sebastiangaiser/helm-charts//.github/renovate/customManagers.json5',
99
],
10-
rebaseWhen: 'conflicted',
11-
customManagers: [
12-
{
13-
customType: 'regex',
14-
managerFilePatterns: [
15-
'/(^|/)Chart\\.yaml$/',
16-
'/(^|/)values\\.yaml$/',
17-
],
18-
matchStrings: [
19-
'#\\s?renovate: image=(?<depName>.*?)\\s?appVersion:\\s?\\"?(?<currentValue>[\\w+\\.\\-]*)',
20-
],
21-
datasourceTemplate: 'docker',
22-
},
23-
],
2410
semanticCommits: 'enabled',
2511
timezone: 'Europe/Berlin',
2612
'pre-commit': {
2713
enabled: true,
2814
},
29-
bumpVersion: 'patch',
3015
}

.github/workflows/commitlint.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/editorconfig.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/helm-docs.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/lint-test.yaml

Lines changed: 69 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,110 @@
11
name: Lint and Test Charts
2+
permissions: {}
23

3-
on: pull_request
4+
on:
5+
pull_request:
6+
branches:
7+
- main
48

59
jobs:
610
lint-test:
711
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
814
strategy:
915
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"
1621
steps:
1722
- name: Checkout
18-
uses: actions/checkout@v5
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1924
with:
2025
fetch-depth: 0
2126

2227
- name: Set up Helm
23-
uses: azure/setup-helm@v4
28+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
2429
with:
25-
version: v3.9.4
30+
# renovate: github=helm/helm
31+
version: v3.19.0
2632

27-
- uses: actions/setup-python@v6
33+
- name: Set up Python
34+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
2835
with:
29-
python-version: 3.14.0
36+
python-version: '3.13'
3037

3138
- 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
3343

3444
- name: Run chart-testing (list-changed)
3545
id: list-changed
3646
run: |
37-
changed=$(ct list-changed --config .github/ct.yaml)
47+
changed=$(ct list-changed --config .github/linters/ct.yaml)
3848
if [[ -n "$changed" ]]; then
39-
echo "changed=true" >> $GITHUB_OUTPUT
49+
echo "changed=true" >> "$GITHUB_OUTPUT"
50+
echo "changed_list=\"${changed//$'\n'/ }\"" >> "$GITHUB_OUTPUT"
4051
fi
4152
4253
- name: Run chart-testing (lint)
43-
run: ct lint --config .github/ct.yaml
54+
run: ct lint --config .github/linters/ct.yaml
4455

4556
- 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
4958
if: steps.list-changed.outputs.changed == 'true'
59+
with:
60+
node_image: ${{ matrix.k8s-version }}
5061

5162
- name: Apply Gateway API CRDs
5263
run: |
5364
kubectl apply -k https://github.com/kubernetes-sigs/gateway-api/config/crd
5465
if: steps.list-changed.outputs.changed == 'true'
5566

56-
- name: Install Zalando's postgres-operator
67+
- name: Apply Prometheus Operator CRDs
68+
env:
69+
CHANGED_LIST: ${{ steps.list-changed.outputs.changed_list }}
5770
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
5972
if: steps.list-changed.outputs.changed == 'true'
6073

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
6576

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
7087

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

.github/workflows/pre-commit.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: pre-commit
2+
permissions: {}
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Python
18+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
19+
with:
20+
python-version: '3.13'
21+
- name: Run pre-commit
22+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

.github/workflows/release.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ jobs:
1313
packages: write # needed for ghcr access
1414
id-token: write # needed for keyless signing
1515

16-
runs-on: ubuntu-24.04
16+
runs-on: ubuntu-latest
1717
steps:
18-
- name: Checkout Code
18+
- name: Checkout
1919
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20-
21-
- name: Fetch history
22-
run: git fetch --prune --unshallow
20+
with:
21+
fetch-depth: 0
2322

2423
- name: Configure Git
2524
run: |
@@ -29,11 +28,8 @@ jobs:
2928
- name: Set up Helm
3029
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
3130
with:
32-
version: v3.12.0
33-
34-
- name: Add dependency chart repos
35-
run: |
36-
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
31+
# renovate: github=helm/helm
32+
version: v3.19.0
3733

3834
- name: Run chart-releaser
3935
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0

.pre-commit-config.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
repos:
22
- repo: https://github.com/norwoodj/helm-docs
3-
rev: 1.14.2
3+
rev: v1.14.2
44
hooks:
5-
- id: helm-docs
6-
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v6.0.0
8-
hooks:
9-
- id: check-json
10-
# - id: check-yaml
11-
- repo: https://github.com/jumanjihouse/pre-commit-hooks
12-
rev: 3.0.0
13-
hooks:
14-
- id: shellcheck
5+
- id: helm-docs-container

charts/capacitor/Chart.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apiVersion: v2
22
name: capacitor
33
description: A Helm chart for deploying capacitor, a general purpose UI for FluxCD
44
type: application
5-
version: 0.2.1
6-
# renovate: image=ghcr.io/gimlet-io/capacitor
5+
version: 0.2.2
6+
# renovate: github=gimlet-io/capacitor
77
appVersion: v0.4.8
8-
maintainers:
9-
- name: sebastiangaiser

0 commit comments

Comments
 (0)