@@ -2,26 +2,25 @@ name: CI
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ main ]
7+ branches : [main]
88
99jobs :
10-
1110 build :
1211 runs-on : ubuntu-latest
1312 steps :
14- - uses : actions/checkout@v3
13+ - uses : actions/checkout@v3
1514
16- # GO tests
17- - name : Set up Go
18- uses : actions/setup-go@v4
19- with :
20- go-version : ' 1.21'
21- cache : false
15+ # GO tests
16+ - name : Set up Go
17+ uses : actions/setup-go@v4
18+ with :
19+ go-version : " 1.21"
20+ cache : false
2221
23- - name : Fmt
24- run : |
22+ - name : Fmt
23+ run : |
2524 # Run gofmt in "diff" mode to check for unformatted code
2625 UNFORMATTED_FILES=$(gofmt -l .)
2726 # Check if any files are unformatted
@@ -33,23 +32,23 @@ jobs:
3332 else
3433 echo "All Go files are properly formatted."
3534 fi
36- - name : Vet
37- run : go vet ./...
35+ - name : Vet
36+ run : go vet ./...
3837
39- - name : Test
40- run : go test ./...
38+ - name : Test
39+ run : go test ./...
4140
42- - name : golangci-lint
43- uses : golangci/golangci-lint-action@v3
44- with :
45- version : v1.54
46- # Generate example charts
47- - name : Generate example charts
48- run : |
41+ - name : golangci-lint
42+ uses : golangci/golangci-lint-action@v3
43+ with :
44+ version : v1.54
45+ # Generate example charts
46+ - name : Generate example charts
47+ run : |
4948 cat test_data/sample-app.yaml | go run ./cmd/helmify examples/app
5049 cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify examples/operator
51- - name : Check that chart examples were commited
52- run : |
50+ - name : Check that chart examples were commited
51+ run : |
5352 if [[ -n "$(git status --porcelain)" ]]; then
5453 # Capture the list of uncommitted files
5554 UNCOMMITTED_FILES=$(git status --porcelain)
@@ -61,36 +60,36 @@ jobs:
6160 else
6261 echo "Chart examples generation check passed. No uncommitted changes."
6362 fi
64- # Dry-run generated charts in cluster
65- - name : Install k8s cluster
66- uses : helm/kind-action@v1.4 .0
67- - name : Install certs
68- run : kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.1/cert-manager.yaml
63+ # Dry-run generated charts in cluster
64+ - name : Install k8s cluster
65+ uses : helm/kind-action@v1.13 .0
66+ - name : Install certs
67+ run : kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.1/cert-manager.yaml
6968
70- - name : Generate operator ci chart
71- run : cat test_data/k8s-operator-ci.yaml | go run ./cmd/helmify examples/operator-ci
72- - name : Fill operator ci secrets
73- run : sed -i 's/""/"abc"/' ./examples/operator-ci/values.yaml
74- - name : Dry-run operator in k8s cluster
75- run : helm template ./examples/operator-ci -n operator-ns --create-namespace | kubectl apply --dry-run=server -f -
69+ - name : Generate operator ci chart
70+ run : cat test_data/k8s-operator-ci.yaml | go run ./cmd/helmify examples/operator-ci
71+ - name : Fill operator ci secrets
72+ run : sed -i 's/""/"abc"/' ./examples/operator-ci/values.yaml
73+ - name : Dry-run operator in k8s cluster
74+ run : helm template ./examples/operator-ci -n operator-ns --create-namespace | kubectl apply --dry-run=server -f -
7675
77- - name : Generate app chart
78- run : cat test_data/sample-app.yaml | go run ./cmd/helmify examples/app
79- - name : Fill app secrets
80- run : sed -i 's/""/"abc"/' ./examples/app/values.yaml
81- - name : Dry-run app in k8s cluster
82- run : helm template ./examples/app -n app-ns --create-namespace | kubectl apply --dry-run=server -f -
76+ - name : Generate app chart
77+ run : cat test_data/sample-app.yaml | go run ./cmd/helmify examples/app
78+ - name : Fill app secrets
79+ run : sed -i 's/""/"abc"/' ./examples/app/values.yaml
80+ - name : Dry-run app in k8s cluster
81+ run : helm template ./examples/app -n app-ns --create-namespace | kubectl apply --dry-run=server -f -
8382
84- # Validate charts with Kubeconform
85- - name : Install Kubeconform
86- run :
go install github.com/yannh/kubeconform/cmd/[email protected] 83+ # Validate charts with Kubeconform
84+ - name : Install Kubeconform
85+ run :
go install github.com/yannh/kubeconform/cmd/[email protected] 8786
88- - name : Validate app
89- 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
87+ - name : Validate app
88+ 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
9089
91- - name : Generate operator example chart
92- run : cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify examples/operator
93- - name : Fill operator example secrets
94- run : sed -i 's/""/"abc"/' ./examples/operator/values.yaml
95- - name : Validate example operator
96- 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
90+ - name : Generate operator example chart
91+ run : cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify examples/operator
92+ - name : Fill operator example secrets
93+ run : sed -i 's/""/"abc"/' ./examples/operator/values.yaml
94+ - name : Validate example operator
95+ 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
0 commit comments