Repository navigation
79 lines (74 loc) · 3.15 KB
/
Copy pathtest-chart.yml
File metadata and controls
79 lines (74 loc) · 3.15 KB
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
# SPDX-FileCopyrightText: SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0
name: Test Chart
on:
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
test-chart:
name: Run Chart Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Set up Helm
uses: azure/setup-helm@v5
with:
version: latest
- name: Lint Helm Chart
run: |
helm lint ./charts/network-operator
- name: Create kind cluster
uses: helm/kind-action@v1
with:
version: v0.31.0
kubectl_version: v1.35.0
cluster_name: kind
- name: Prepare network-operator
run: |
go mod download
make docker-build IMG=network-operator:v0.1.0
kind load docker-image network-operator:v0.1.0
- name: Install cert-manager via Helm
run: |
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true
- name: Wait for cert-manager to be ready
run: |
kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager
kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-cainjector
kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-webhook
- name: Install Prometheus Operator CRDs
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus-crds prometheus-community/prometheus-operator-crds
- name: Install Prometheus via Helm
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/prometheus --namespace monitoring --create-namespace
- name: Wait for Prometheus to be ready
run: |
kubectl wait --namespace monitoring --for=condition=available --timeout=300s deployment/prometheus-server
- name: Install Helm Chart
run: |
helm install network-operator ./charts/network-operator --create-namespace --namespace network-operator-system --set manager.image.repository=network-operator --set manager.image.tag=v0.1.0 --set prometheus.enabled=true
- name: Check Helm release status
run: |
helm status network-operator --namespace network-operator-system
- name: Check Presence of ServiceMonitor
run: |
kubectl wait --namespace network-operator-system --for=jsonpath='{.kind}'=ServiceMonitor servicemonitor/network-operator-controller-manager-metrics-monitor