-
Notifications
You must be signed in to change notification settings - Fork 139
67 lines (54 loc) · 2.38 KB
/
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# GO tests
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Fmt
run: go fmt ./...
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
# Dry-run generated charts in cluster
- name: Install k8s cluster
uses: helm/[email protected]
- name: Install certs
run: kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.1/cert-manager.yaml
- name: Generate operator ci chart
run: cat test_data/k8s-operator-ci.yaml | go run ./cmd/helmify examples/operator-ci
- name: Fill operator ci secrets
run: sed -i 's/""/"abc"/' ./examples/operator-ci/values.yaml
- name: Dry-run operator in k8s cluster
run: helm template ./examples/operator-ci -n operator-ns --create-namespace | kubectl apply --dry-run=server -f -
- name: Generate app chart
run: cat test_data/sample-app.yaml | go run ./cmd/helmify examples/app
- name: Fill app secrets
run: sed -i 's/""/"abc"/' ./examples/app/values.yaml
- name: Dry-run app in k8s cluster
run: helm template ./examples/app -n app-ns --create-namespace | kubectl apply --dry-run=server -f -
# Validate charts with Kubeconform
- name: Install Kubeconform
run: go install github.com/yannh/kubeconform/cmd/[email protected]
- name: Validate app
run: helm template ./examples/app -n app-ns --create-namespace | kubeconform -schema-location 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json' -strict
- name: Generate operator example chart
run: cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify examples/operator
- name: Fill operator example secrets
run: sed -i 's/""/"abc"/' ./examples/operator/values.yaml
- name: Validate example operator
run: helm template ./examples/operator -n operator-ns --create-namespace | kubeconform -schema-location 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json' -strict