Repository navigation
201 lines (173 loc) · 6.66 KB
/
Copy pathci.yaml
File metadata and controls
201 lines (173 loc) · 6.66 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
build:
name: "Build & Test"
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
- name: Run unit tests
run: make test
- name: Verify README flag tables
run: make verify-readme
- name: Verify installation
run: |
mkdir -p helmhome
make install HELM_HOME=helmhome
helmhome/plugins/helm-diff/bin/diff version
helm-install:
name: helm install
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: [build]
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
shell: [default]
experimental: [false]
helm-version: [v3.18.6, v3.22.0, v4.3.0]
include:
- os: windows-latest
shell: wsl
experimental: false
helm-version: v3.18.6
- os: windows-latest
shell: cygwin
experimental: false
helm-version: v3.18.6
- os: ubuntu-latest
container: alpine
shell: sh
experimental: false
helm-version: v3.18.6
- os: windows-latest
shell: wsl
experimental: false
helm-version: v3.22.0
- os: windows-latest
shell: cygwin
experimental: false
helm-version: v3.22.0
- os: ubuntu-latest
container: alpine
shell: sh
experimental: false
helm-version: v3.22.0
- os: windows-latest
shell: wsl
experimental: false
helm-version: v4.3.0
- os: windows-latest
shell: cygwin
experimental: false
helm-version: v4.3.0
- os: ubuntu-latest
container: alpine
shell: sh
experimental: false
helm-version: v4.3.0
steps:
- name: Disable autocrlf
if: "contains(matrix.os, 'windows-latest')"
run: |-
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v7
- name: Setup Helm
uses: azure/setup-helm@v5
with:
version: "${{ matrix.helm-version }}"
- name: Setup WSL
if: "contains(matrix.shell, 'wsl')"
uses: Vampire/setup-wsl@v7
- name: Setup Cygwin
if: "contains(matrix.shell, 'cygwin')"
uses: egor-tensin/setup-cygwin@v4
- name: helm plugin install
run: helm plugin install --debug .
integration-tests:
name: Integration Tests
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Helm maintains the latest minor version only and therefore each Helmfile version supports 2 Helm minor versions.
# That's why we cover only 2 Helm minor versions in this matrix.
# See https://github.com/helmfile/helmfile/pull/286#issuecomment-1250161182 for more context.
- helm-version: v3.18.6
- helm-version: v3.22.0
- helm-version: v4.3.0
steps:
- uses: helm/kind-action@v1.15.1
with:
cluster_name: kind
- uses: actions/checkout@v7
- name: Setup Helm
uses: azure/setup-helm@v5
with:
version: ${{ matrix.helm-version }}
- name: Helm Version
run: helm version
- name: helm plugin install
run: make install/helm
- name: helm create helm-diff
run: helm create helm-diff
- name: helm diff upgrade --install helm-diff ./helm-diff
run: helm diff upgrade --install helm-diff ./helm-diff
- name: helm upgrade -i helm-diff ./helm-diff
run: helm upgrade -i helm-diff ./helm-diff
- name: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
run: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
# Flux-style setup: the release storage (sh.helm.release.v1.* secrets) lives
# in a separate storage namespace (flux-system) while the workloads are
# deployed into the target namespace (prod-apps). Exercises --storage-namespace,
# HELM_DIFF_STORAGE_NAMESPACE and the three-way-merge pipeline against a
# real cluster.
- name: Install release into prod-apps and move its storage to flux-system
run: |
helm upgrade -i storage-diff ./helm-diff -n prod-apps --create-namespace
kubectl create namespace flux-system
for secret in $(kubectl get secrets -n prod-apps -o name | grep '^secret/sh\.helm\.release\.v1\.storage-diff\.'); do
kubectl get -n prod-apps "${secret}" -o json \
| jq --arg ns flux-system '.metadata.namespace = $ns | del(.metadata.resourceVersion, .metadata.uid, .metadata.creationTimestamp)' \
| kubectl apply -f -
kubectl delete -n prod-apps "${secret}"
done
- name: Verify release storage is only visible in flux-system
run: |
if helm get manifest storage-diff -n prod-apps >/dev/null 2>&1; then
echo "unexpected: release storage still found in prod-apps" >&2
exit 1
fi
helm get manifest storage-diff -n flux-system >/dev/null
- name: helm diff upgrade fails without --storage-namespace
run: |
if helm diff upgrade storage-diff ./helm-diff -n prod-apps >/dev/null 2>&1; then
echo "unexpected: diff succeeded although the release storage is not in prod-apps" >&2
exit 1
fi
- name: helm diff upgrade --storage-namespace
run: helm diff upgrade storage-diff ./helm-diff -n prod-apps --storage-namespace flux-system
- name: helm diff upgrade with HELM_DIFF_STORAGE_NAMESPACE env var
run: HELM_DIFF_STORAGE_NAMESPACE=flux-system helm diff upgrade storage-diff ./helm-diff -n prod-apps
- name: helm diff upgrade --storage-namespace --three-way-merge
run: |
set -o pipefail
helm diff upgrade storage-diff ./helm-diff -n prod-apps --storage-namespace flux-system --three-way-merge --set replicaCount=2 | tee /tmp/three-way.out
grep -q 'replicas: 2' /tmp/three-way.out
- name: Run issue reproduction tests (scripts/issues)
run: scripts/issues/run.sh