-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.48 KB
/
chart-ci.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
name: Chart CI
on:
pull_request:
paths:
- 'charts/**'
- .github/workflows/chart-ci.yml
jobs:
helm-lint-test:
name: Helm chart
runs-on: ubuntu-latest
env:
CT_TARGET_BRANCH: ${{ github.event.repository.default_branch }}
CT_CHART_DIRS: charts
CT_GITHUB_GROUPS: "true"
CT_USE_HELMIGNORE: "true"
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4.2.0
- name: Set up python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.x'
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (lint)
run: ct lint
- name: Prepare host path mounts
run: |
mkdir -p ${{ runner.temp }}/run/udev/data
cat > ${{ runner.temp }}/kind-config.yaml <<EOM
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: ${{ runner.temp }}/run/udev/data
containerPath: /run/udev/data
propagation: None
EOM
- name: Create kind cluster
uses: helm/kind-action@v1.10.0
with:
config: ${{ runner.temp }}/kind-config.yaml
- name: Create dummy secret
run: |
kubectl -n kube-system create secret generic dummy --from-literal token=test
- name: Install required CRDs
run: |
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
# TODO(avorima): Install chart using ct once packages are available
- name: Install helm chart (dry-run)
run: >
helm show crds $CHART | kubectl apply -f -;
helm install ionoscloud-blockstorage-csi-driver $CHART -n kube-system -n kube-system -f $CHART/ci/ct-values.yaml --dry-run -o json | jq -r '.manifest' |
kubectl apply --dry-run=server --validate=true -f -
env:
CHART: ./charts/ionoscloud-blockstorage-csi-driver
helm-docs-validate:
name: Helm docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
- name: Run helm-docs
uses: docker://jnorwood/helm-docs:v1.13.1
- name: Check for changes
run: git diff --quiet charts/*/README.md