-
Notifications
You must be signed in to change notification settings - Fork 147
106 lines (90 loc) · 3.86 KB
/
lint-and-test.yaml
File metadata and controls
106 lines (90 loc) · 3.86 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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Helm lint and test chart
# Controls when the workflow will run
on:
pull_request:
branches:
- master
paths:
- .github/**
- charts/mailu/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5
with:
version: v3.10.0
- name: Install dependencies
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm dependency build charts/mailu
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
with:
python-version: "3.14"
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
with:
yamale_version: "6.0.0"
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
with:
config: kind-cluster.yaml
- name: Install Calico
if: steps.list-changed.outputs.changed == 'true'
run: |
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml
kubectl -n kube-system rollout status daemonset/calico-node --timeout=120s
kubectl -n kube-system rollout status deployment calico-kube-controllers --timeout=120s
- name: Fix CoreDNS upstream resolver
if: steps.list-changed.outputs.changed == 'true'
run: |
kubectl -n kube-system get configmaps coredns -o yaml | sed 's/forward . \/etc\/resolv.conf/forward . 8.8.8.8:53/g' | kubectl apply -f -
kubectl -n kube-system rollout restart deployment coredns
kubectl -n kube-system rollout status deployment coredns --timeout=120s
- name: Install Prometheus CRDs (required for serviceMonitors)
if: steps.list-changed.outputs.changed == 'true'
run: |
kubectl create -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/bundle.yaml
- name: Run chart-testing (install)
id: install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --debug --config ct.yaml
check-readme-update:
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- name: Install readme-generator-for-helm
run: npm install -g @bitnami/readme-generator-for-helm
- name: Checkout mailu/helm-charts
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
fetch-depth: 0
- name: Execute readme-generator-for-helm
run: |
echo "Updating README.md for mailu chart"
readme-generator --values "charts/mailu/values.yaml" --readme "charts/mailu/README.md" --schema "/tmp/schema.json"
git diff --exit-code --name-status charts/mailu/README.md || {
echo "README update is missing. This should have been prevented by pre-commit hook."
exit 1
}