-
Notifications
You must be signed in to change notification settings - Fork 11
186 lines (165 loc) · 7.35 KB
/
chart-test.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Copyright (C) Nicolas Lamirault <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Charts / Lint and Test
on:
push:
branches:
- master
paths:
- "charts/**"
- "charts/**/*.yaml"
- "charts/**/templates/*.yaml"
- "charts/**/dashboards/*.json"
pull_request:
branches:
- master
paths:
- "charts/**"
- "charts/**/*.yaml"
- "charts/**/templates/*.yaml"
- "charts/**/dashboards/*.json"
permissions:
contents: read
jobs:
# Reference https://github.com/marketplace/actions/helm-chart-testing
lint-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Fetch history
run: git fetch --prune --unshallow
- name: Setup chart-testing
uses: helm/[email protected]
- name: List changed
run: |
changed=$(ct list-changed --config .github/ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Lint
run: |
ct lint --config .github/ct.yaml
# lint-docs:
# runs-on: ubuntu-latest
# needs: lint-chart
# steps:
# - name: Checkout
# uses: actions/[email protected]
# - name: Run helm-docs
# run: .github/helm-docs.sh
# kubeval-chart:
# runs-on: ubuntu-latest
# needs:
# - lint-chart
# - lint-docs
# strategy:
# matrix:
# k8s:
# # from https://github.com/instrumenta/kubernetes-json-schema
# - v1.14.10
# - v1.15.7
# - v1.16.4
# - v1.17.4
# - v1.18.1
# steps:
# - name: Checkout
# uses: actions/[email protected]
# with:
# fetch-depth: 0
# - name: Run kubeval
# env:
# KUBERNETES_VERSION: ${{ matrix.k8s }}
# run: .github/kubeval.sh
install-chart:
name: install-chart
runs-on: ubuntu-latest
needs:
- lint-chart
# - lint-docs
# - kubeval-chart
strategy:
matrix:
k8s:
# from https://hub.docker.com/r/kindest/node/tags
- v1.22.0
- v1.23.0
- v1.24.0
- v1.25.0
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Setup chart-testing
uses: helm/[email protected]
# with:
# version: v3.3.0
- name: Create kind ${{ matrix.k8s }} cluster
uses: helm/[email protected]
with:
node_image: kindest/node:${{ matrix.k8s }}
wait: 120s
- name: Install Helm dependencies
run: |
# Prometheus Operator CRDs
# datasource=github-tags depName=prometheus-operator/prometheus-operator
PROM_OPERATOR_VERSION=v0.61.0
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/${PROM_OPERATOR_VERSION}/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml
# Kyverno
helm repo add kyverno https://kyverno.github.io/kyverno/
helm repo update
helm install my-kyverno kyverno/kyverno --namespace kyverno --create-namespace
sleep 10
kubectl get crds
# Crossplane
helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update
helm install crossplane --namespace crossplane-system crossplane-stable/crossplane --create-namespace
sleep 10
# ACK
export ACK_SYSTEM_NAMESPACE=ack-system
# datasource=github-tags depName=aws-controllers-k8s/ec2-controller
export ACK_EC2_VERSION=v0.1.0
# datasource=github-tags depName=aws-controllers-k8s/ecr-controller
export ACK_ECR_VERSION=v0.1.8
# datasource=github-tags depName=aws-controllers-k8s/eks-controller
export ACK_EKS_VERSION=v0.1.7
# datasource=github-tags depName=aws-controllers-k8s/iam-controller
export ACK_IAM_VERSION=v0.1.1
# datasource=github-tags depName=aws-controllers-k8s/s3-controller
export ACK_S3_VERSION=v0.1.6
helm upgrade --install --create-namespace --namespace ${ACK_SYSTEM_NAMESPACE} ack-ec2-controller \
oci://public.ecr.aws/aws-controllers-k8s/ec2-chart --version=${ACK_EC2_VERSION}
helm upgrade --install --create-namespace --namespace ${ACK_SYSTEM_NAMESPACE} ack-ecr-controller \
oci://public.ecr.aws/aws-controllers-k8s/ecr-chart --version=${ACK_ECR_VERSION}
helm upgrade --install --create-namespace --namespace ${ACK_SYSTEM_NAMESPACE} ack-eks-controller \
oci://public.ecr.aws/aws-controllers-k8s/eks-chart --version=${ACK_EKS_VERSION}
helm upgrade --install --create-namespace --namespace ${ACK_SYSTEM_NAMESPACE} ack-iam-controller \
oci://public.ecr.aws/aws-controllers-k8s/iam-chart --version=${ACK_IAM_VERSION}
helm upgrade --install --create-namespace --namespace ${ACK_SYSTEM_NAMESPACE} ack-s3-controller \
oci://public.ecr.aws/aws-controllers-k8s/s3-chart --version=${ACK_S3_VERSION}
sleep 10
- name: Run chart-testing (install)
run: |
ct install --config .github/ct.yaml