-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (83 loc) · 3.06 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Lint and Test Charts
on:
pull_request:
branches: [master]
permissions: read-all
jobs:
lint:
runs-on: ubuntu-22.04
container: ghcr.io/chgl/kube-powertools:v2.1.24@sha256:20fab71c106f2f8f61271bf5471da151d6a0b81373b2c8de92db75b50e463eb9
steps:
- name: Add workspace as safe directory
run: |
git config --global --add safe.directory /__w/charts/charts
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
# via <https://github.com/helm/chart-testing/issues/577>
- run: |
git branch "master" "origin/master"
- name: Check if documentation is up-to-date
run: |
generate-docs.sh
if git diff --exit-code HEAD; then
echo -e "\033[0;32mDocumentation up to date\033[0m ✔"
else
echo -e "\033[0;31mDocumentation outdated! Please run generate-docs.sh locally and push the changes.\033[0m ❌"
git diff --color
exit 1
fi
- name: Update dependencies
run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \;
- name: Run YAML lint
run: yamllint .
- name: Run chart-testing (lint)
run: ct lint --config .github/ct/ct.yaml
- name: Run ArtifactHub lint
run: ah lint --kind=helm
- name: Cache kubeconform schemas
id: cache-powerlint-kubeconform
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: /tmp
key: ${{ runner.os }}-powerlint-kubeconform
- name: Run Powerlint
env:
KUBERNETES_VERSIONS: "1.24.0 1.25.0 1.26.0"
run: chart-powerlint.sh
# used to test whether the changelog generation process works
- name: Generate changelogs (test)
run: generate-chart-changelog.sh
test:
runs-on: ubuntu-22.04
needs:
- lint
strategy:
matrix:
k8s-version: [1.24.7, 1.25.3, 1.26.0]
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
# via <https://github.com/helm/chart-testing/issues/577>
- run: |
git branch "master" "origin/master"
- name: Set up chart-testing
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create k8s Kind Cluster
uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0
if: steps.list-changed.outputs.changed == 'true'
with:
cluster_name: kind-cluster-k8s-${{ matrix.k8s-version }}
node_image: kindest/node:v${{ matrix.k8s-version }}
- name: Run chart-testing (install)
run: ct install --config .github/ct/install.yaml