-
Notifications
You must be signed in to change notification settings - Fork 16
168 lines (146 loc) · 5.98 KB
/
Copy pathlint-test-common-services.yaml
File metadata and controls
168 lines (146 loc) · 5.98 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
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
name: Lint and Test Common Services Charts
on:
workflow_dispatch:
pull_request:
paths:
- 'charts/common-services/**'
env:
HELM_VERSION: v3.14.4
PYTHON_VERSION: 3.9
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
jobs:
lint:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.HELM_VERSION }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache Helm plugins
uses: actions/cache@v3
with:
path: ~/.local/share/helm/plugins
key: ${{ runner.os }}-helm-plugins-${{ hashFiles('**/requirements.txt') }}
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ env.DEFAULT_BRANCH }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Add helm repos
run: |
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add elastic https://helm.elastic.co
helm repo add kibana https://helm.elastic.co
helm repo add argo-cd https://argoproj.github.io/argo-helm
helm repo add haproxy https://haproxytech.github.io/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add runix https://helm.runix.net
helm repo add opensearch https://opensearch-project.github.io/helm-charts
helm repo add fluent https://fluent.github.io/helm-charts
helm repo add velero https://vmware-tanzu.github.io/helm-charts
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm repo add velero-ui https://helm.otwld.com
- name: Run chart-testing (lint)
run: ct lint --target-branch ${{ env.DEFAULT_BRANCH }}
test:
needs: lint
runs-on: ubuntu-latest
if: needs.lint.outputs.changed == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.HELM_VERSION }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache Helm plugins
uses: actions/cache@v3
with:
path: ~/.local/share/helm/plugins
key: ${{ runner.os }}-helm-plugins-${{ hashFiles('**/requirements.txt') }}
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Create kind cluster
uses: helm/kind-action@v1
with:
config: .config/kind.yaml
- name: Kind cluster-info
run: |
kubectl cluster-info --context kind-chart-testing
kubectl get nodes --context kind-chart-testing
- name: Install Prometheus Operator CRDs
run: |
curl -sSL -o /tmp/prom-crds.yaml https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
curl -sSL -o /tmp/prom-podmonitor-crd.yaml https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
curl -sSL -o /tmp/prom-rule-crd.yaml https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
kubectl apply -f /tmp/prom-crds.yaml
kubectl apply -f /tmp/prom-podmonitor-crd.yaml
kubectl apply -f /tmp/prom-rule-crd.yaml
shell: bash
- name: Run chart-testing (install)
run: |
ct install --charts=charts/common-services \
--helm-extra-args="--timeout=15m0s" \
--helm-extra-set-args="--set=velero-ui.enabled=false \
--set=elasticsearch.replicas=1 \
--set=elasticsearch.clusterHealthCheckParams=wait_for_status=yellow&timeout=60s \
--set=pgadmin4.enabled=false \
--set=slamd.enabled=false \
--set=shellinabox.enabled=false \
--set=curator.enabled=false \
--set=zoonavigator.enabled=false \
--set=backupManager.enabled=false" \
--debug --skip-missing-values
# Temp Helm Chart hosted as an OCI image on ghcr
publish-ghcr:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: read-yaml-file
uses: mikefarah/yq@master
id: read_chart
with:
cmd: yq '.version' charts/common-services/Chart.yaml
- name: Chart | Push
uses: appany/helm-oci-chart-releaser@v0.4.1
with:
name: common-services
repository: helm
tag: ${{ steps.read_chart.outputs.result }}
registry: ghcr.io/${{ github.repository_owner }}
path: charts/common-services
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: 'true' # Defaults to false