Skip to content

Commit 1d6468e

Browse files
committed
feat: add helm e2e to CI
Add kres configuration to enable testing Helm Chart in the CI. Signed-off-by: Mateusz Urbanek <[email protected]>
1 parent 2f0499c commit 1d6468e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+393
-134
lines changed

.conform.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-12-08T13:14:36Z by kres 9fb16fe.
3+
# Generated on 2026-01-23T17:48:08Z by kres 1ffefb6.
44

55
policies:
66
- type: commit
@@ -57,7 +57,7 @@ policies:
5757
- .pb.go
5858
- .pb.gw.go
5959
header: |
60-
// Copyright (c) 2025 Sidero Labs, Inc.
60+
// Copyright (c) 2026 Sidero Labs, Inc.
6161
//
6262
// Use of this software is governed by the Business Source License
6363
// included in the LICENSE file.

.github/workflows/ci.yaml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2026-01-09T09:46:37Z by kres 0e8da31.
3+
# Generated on 2026-01-23T13:31:16Z by kres 1ffefb6.
44

55
concurrency:
66
group: ${{ github.head_ref || github.run_id }}
@@ -18,6 +18,56 @@ concurrency:
1818
- release-*
1919
name: default
2020
jobs:
21+
chart-e2e:
22+
runs-on:
23+
group: generic
24+
if: github.event_name == 'pull_request'
25+
needs:
26+
- default
27+
steps:
28+
- name: gather-system-info
29+
id: system-info
30+
uses: kenchan0130/actions-system-info@59699597e84e80085a750998045983daa49274c4 # version: v1.4.0
31+
continue-on-error: true
32+
- name: print-system-info
33+
run: |
34+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
35+
36+
OUTPUTS=(
37+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
38+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
39+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
40+
"NodeName: ${NODE_NAME}"
41+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
42+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
43+
"Name: ${{ steps.system-info.outputs.name }}"
44+
"Platform: ${{ steps.system-info.outputs.platform }}"
45+
"Release: ${{ steps.system-info.outputs.release }}"
46+
"Total memory: ${MEMORY_GB} GB"
47+
)
48+
49+
for OUTPUT in "${OUTPUTS[@]}";do
50+
echo "${OUTPUT}"
51+
done
52+
continue-on-error: true
53+
- name: checkout
54+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
55+
- name: Unshallow
56+
run: |
57+
git fetch --prune --unshallow
58+
- name: Set up Docker Buildx
59+
id: setup-buildx
60+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
61+
with:
62+
driver: remote
63+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
64+
timeout-minutes: 10
65+
- name: chart-e2e-ci
66+
if: github.event_name == 'pull_request'
67+
env:
68+
REGISTRY: registry.dev.siderolabs.io
69+
run: |
70+
make chart-e2e-ci
2171
default:
2272
permissions:
2373
actions: read
@@ -121,6 +171,14 @@ jobs:
121171
if: github.event_name == 'pull_request'
122172
run: |
123173
make check-dirty
174+
- name: tools
175+
if: github.event_name == 'pull_request'
176+
run: |
177+
make tools
178+
- name: chart-test
179+
if: github.event_name == 'pull_request'
180+
run: |
181+
make chart-test
124182
- name: Generate Checksums
125183
if: startsWith(github.ref, 'refs/tags/')
126184
run: |

.kres.yaml

Lines changed: 186 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,26 @@ spec:
105105
toplevel: true
106106
- name: docker-compose-down
107107
toplevel: true
108+
- name: talosctl
109+
toplevel: true
110+
- name: helm-unittest
111+
toplevel: true
112+
- name: kubectl-kuttl
113+
toplevel: true
114+
- name: tools
115+
toplevel: true
116+
- name: chart-test
117+
toplevel: true
118+
- name: k8s-up
119+
toplevel: true
120+
- name: k8s-down
121+
toplevel: true
122+
- name: chart-e2e
123+
toplevel: true
124+
- name: chart-e2e-ci
125+
toplevel: true
126+
- name: chart-version
127+
toplevel: true
108128
---
109129
kind: custom.Step
110130
name: imager-base
@@ -747,12 +767,12 @@ spec:
747767
params:
748768
Licensor: Sidero Labs, Inc.
749769
LicensedWork: Image Factory
750-
Copyright: (c) 2025 Sidero Labs, Inc.
770+
Copyright: (c) 2026 Sidero Labs, Inc.
751771
ChangeDate: "2030-01-22"
752772
ChangeLicense: Mozilla Public License, version 2.0
753773
EnterpriseLink: https://www.siderolabs.com/contact/
754774
header: |
755-
// Copyright (c) 2025 Sidero Labs, Inc.
775+
// Copyright (c) 2026 Sidero Labs, Inc.
756776
//
757777
// Use of this software is governed by the Business Source License
758778
// included in the LICENSE file.
@@ -772,7 +792,7 @@ spec:
772792

773793
- root: enterprise
774794
header: |
775-
// Copyright (c) 2025 Sidero Labs, Inc.
795+
// Copyright (c) 2026 Sidero Labs, Inc.
776796
//
777797
// Use of this software is governed by the Business Source License
778798
// included in the LICENSE file.
@@ -825,3 +845,166 @@ spec:
825845
ghaction:
826846
enabled: true
827847
condition: on-pull-request
848+
---
849+
kind: custom.Step
850+
name: talosctl
851+
spec:
852+
makefile:
853+
enabled: true
854+
phony: true
855+
depends:
856+
- $(ARTIFACTS)
857+
variables:
858+
- name: GOOS
859+
defaultValue: $(shell uname -s | tr "[:upper:]" "[:lower:]")
860+
- name: TALOS_VERSION
861+
defaultValue: 1.12.2
862+
script:
863+
- |
864+
curl -Lo $(ARTIFACTS)/talosctl https://github.com/siderolabs/talos/releases/download/v$(TALOS_VERSION)/talosctl-$(GOOS)-$(GOARCH)
865+
chmod +x $(ARTIFACTS)/talosctl
866+
---
867+
kind: custom.Step
868+
name: helm-unittest
869+
spec:
870+
makefile:
871+
enabled: true
872+
phony: true
873+
script:
874+
- |
875+
-helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false
876+
---
877+
kind: custom.Step
878+
name: kubectl-kuttl
879+
spec:
880+
makefile:
881+
enabled: true
882+
phony: true
883+
depends:
884+
- $(ARTIFACTS)
885+
script:
886+
- |
887+
kubectl krew install kuttl
888+
---
889+
kind: custom.Step
890+
name: tools
891+
spec:
892+
makefile:
893+
enabled: true
894+
phony: true
895+
depends:
896+
- talosctl
897+
- kubectl-kuttl
898+
- helm-unittest
899+
ghaction:
900+
enabled: true
901+
condition: on-pull-request
902+
---
903+
kind: custom.Step
904+
name: k8s-up
905+
spec:
906+
makefile:
907+
enabled: true
908+
phony: true
909+
depends:
910+
- $(ARTIFACTS)
911+
variables:
912+
- name: K8S_VERSION
913+
defaultValue: v1.35.0
914+
script:
915+
- |
916+
$(ARTIFACTS)/talosctl cluster create docker \
917+
--name=image-factory-env \
918+
--talosconfig-destination=$(ARTIFACTS)/talosconfig \
919+
--kubernetes-version=$(K8S_VERSION) \
920+
--mtu=1450
921+
$(ARTIFACTS)/talosctl kubeconfig $(ARTIFACTS)/kubeconfig \
922+
--talosconfig=$(ARTIFACTS)/talosconfig \
923+
--nodes=10.5.0.2 \
924+
--force
925+
---
926+
kind: custom.Step
927+
name: k8s-down
928+
spec:
929+
makefile:
930+
enabled: true
931+
phony: true
932+
script:
933+
- |
934+
$(ARTIFACTS)/talosctl cluster destroy \
935+
--name=image-factory-env
936+
rm -f $(ARTIFACTS)/talosconfig $(ARTIFACTS)/kubeconfig
937+
---
938+
kind: custom.Step
939+
name: chart-test
940+
spec:
941+
makefile:
942+
enabled: true
943+
phony: true
944+
script:
945+
- |
946+
helm unittest deploy/helm/image-factory
947+
ghaction:
948+
enabled: true
949+
condition: on-pull-request
950+
---
951+
kind: custom.Step
952+
name: k8s-down
953+
spec:
954+
makefile:
955+
enabled: true
956+
phony: true
957+
script:
958+
- |
959+
$(ARTIFACTS)/talosctl cluster destroy \
960+
--name=image-factory-env
961+
rm -f $(ARTIFACTS)/talosconfig $(ARTIFACTS)/kubeconfig
962+
---
963+
kind: custom.Step
964+
name: chart-version
965+
spec:
966+
makefile:
967+
enabled: true
968+
phony: true
969+
variables:
970+
- name: CHART_VERSION
971+
defaultValue: "0.0.0-alpha.0"
972+
script:
973+
- yq -i '.version = strenv(CHART_VERSION)' deploy/helm/image-factory/Chart.yaml
974+
- yq -i '.appVersion = strenv(TAG)' deploy/helm/image-factory/Chart.yaml
975+
- |
976+
sed -i '/# -- Repository to use for Image Factory/{n; s|repository:.*|repository: '"$(REGISTRY)/$(USERNAME)/image-factory"'|}' deploy/helm/image-factory/values.yaml
977+
---
978+
kind: custom.Step
979+
name: chart-e2e
980+
spec:
981+
makefile:
982+
enabled: true
983+
phony: true
984+
script:
985+
- |
986+
export KUBECONFIG=$(shell pwd)/$(ARTIFACTS)/kubeconfig \
987+
&& cd deploy/helm/e2e \
988+
&& kubectl kuttl test
989+
---
990+
kind: custom.Step
991+
name: chart-e2e-ci
992+
spec:
993+
makefile:
994+
enabled: true
995+
phony: true
996+
depends:
997+
- tools
998+
script:
999+
- "@$(MAKE) image-image-factory PUSH=true"
1000+
- "@$(MAKE) chart-version CHART_VERSION=v1.0.0-test.1 REGISTRY=$(REGISTRY) USERNAME=$(USERNAME) TAG=$(TAG)"
1001+
- "@$(MAKE) k8s-up"
1002+
- "@$(MAKE) chart-e2e"
1003+
ghaction:
1004+
enabled: true
1005+
condition: on-pull-request
1006+
parallelJob:
1007+
name: chart-e2e
1008+
runnerGroup: generic
1009+
environment:
1010+
REGISTRY: registry.dev.siderolabs.io

Makefile

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2026-01-21T13:19:04Z by kres 1ffefb6.
3+
# Generated on 2026-01-26T09:38:32Z by kres 1ffefb6.
44

55
# common variables
66

@@ -90,6 +90,10 @@ RUN_TESTS_S3 ?= TestIntegrationS3
9090
RUN_TESTS_CDN ?= TestIntegrationCDN
9191
RUN_TESTS_PROXY ?= TestIntegrationDirect
9292
RUN_TESTS_ENTERPRISE ?= TestIntegrationDirect
93+
GOOS ?= $(shell uname -s | tr "[:upper:]" "[:lower:]")
94+
TALOS_VERSION ?= 1.12.2
95+
K8S_VERSION ?= v1.35.0
96+
CHART_VERSION ?= 0.0.0-alpha.0
9397

9498
# help menu
9599

@@ -350,6 +354,63 @@ docker-compose-up:
350354
docker-compose-down:
351355
@IMAGE_FACTORY_IMAGE=$(REGISTRY)/$(USERNAME)/image-factory:$(IMAGE_TAG) docker compose -f hack/dev/compose.yaml down
352356

357+
.PHONY: talosctl
358+
talosctl: $(ARTIFACTS)
359+
curl -Lo $(ARTIFACTS)/talosctl https://github.com/siderolabs/talos/releases/download/v$(TALOS_VERSION)/talosctl-$(GOOS)-$(GOARCH)
360+
chmod +x $(ARTIFACTS)/talosctl
361+
362+
.PHONY: helm-unittest
363+
helm-unittest:
364+
-helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false
365+
366+
.PHONY: kubectl-kuttl
367+
kubectl-kuttl: $(ARTIFACTS)
368+
kubectl krew install kuttl
369+
370+
.PHONY: tools
371+
tools: talosctl kubectl-kuttl helm-unittest
372+
373+
.PHONY: chart-test
374+
chart-test:
375+
helm unittest deploy/helm/image-factory
376+
377+
.PHONY: k8s-up
378+
k8s-up: $(ARTIFACTS)
379+
$(ARTIFACTS)/talosctl cluster create docker \
380+
--name=image-factory-env \
381+
--talosconfig-destination=$(ARTIFACTS)/talosconfig \
382+
--kubernetes-version=$(K8S_VERSION) \
383+
--mtu=1450
384+
$(ARTIFACTS)/talosctl kubeconfig $(ARTIFACTS)/kubeconfig \
385+
--talosconfig=$(ARTIFACTS)/talosconfig \
386+
--nodes=10.5.0.2 \
387+
--force
388+
389+
.PHONY: k8s-down
390+
k8s-down:
391+
$(ARTIFACTS)/talosctl cluster destroy \
392+
--name=image-factory-env
393+
rm -f $(ARTIFACTS)/talosconfig $(ARTIFACTS)/kubeconfig
394+
395+
.PHONY: chart-e2e
396+
chart-e2e:
397+
export KUBECONFIG=$(shell pwd)/$(ARTIFACTS)/kubeconfig \
398+
&& cd deploy/helm/e2e \
399+
&& kubectl kuttl test
400+
401+
.PHONY: chart-e2e-ci
402+
chart-e2e-ci: tools
403+
@$(MAKE) image-image-factory PUSH=true
404+
@$(MAKE) chart-version CHART_VERSION=v1.0.0-test.1 REGISTRY=$(REGISTRY) USERNAME=$(USERNAME) TAG=$(TAG)
405+
@$(MAKE) k8s-up
406+
@$(MAKE) chart-e2e
407+
408+
.PHONY: chart-version
409+
chart-version:
410+
yq -i '.version = strenv(CHART_VERSION)' deploy/helm/image-factory/Chart.yaml
411+
yq -i '.appVersion = strenv(TAG)' deploy/helm/image-factory/Chart.yaml
412+
sed -i '/# -- Repository to use for Image Factory/{n; s|repository:.*|repository: '"$(REGISTRY)/$(USERNAME)/image-factory"'|}' deploy/helm/image-factory/values.yaml
413+
353414
.PHONY: rekres
354415
rekres:
355416
@docker pull $(KRES_IMAGE)

0 commit comments

Comments
 (0)