File tree Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 91
91
with :
92
92
token : ${{ secrets.CODECOV_TOKEN }}
93
93
file : coverage.out
94
+
95
+ test-manifests :
96
+ name : Ensure kubernetes manifests conform to their schema
97
+ runs-on : ubuntu-latest
98
+ steps :
99
+ - name : Checkout code
100
+ uses : actions/checkout@v3
101
+ - name : Install Kubeconform
102
+ run : |
103
+ set -xo pipefail
104
+
105
+ curl -sLf --retry 3 \
106
+ -o /tmp/kubeconform.tar.gz \
107
+ "https://github.com/yannh/kubeconform/releases/download/v0.6.6/kubeconform-linux-amd64.tar.gz"
108
+ chksum=$(sha256sum /tmp/kubeconform.tar.gz | awk '{ print $1; }')
109
+ if test "${chksum}" != "2ff56999a6ed9e96fe5ab9ee52271f2db5335baf7f17789035b9561970cdd3eb"; then
110
+ echo "Checksum mismatch" >&2
111
+ exit 1
112
+ fi
113
+
114
+ tar -C /tmp -xvzf /tmp/kubeconform.tar.gz
115
+ sudo mv /tmp/kubeconform /usr/local/bin/kubeconform
116
+ chmod +x /usr/local/bin/kubeconform
117
+ - name : Run manifest tests
118
+ run : |
119
+ make test-manifests
Original file line number Diff line number Diff line change @@ -67,9 +67,16 @@ mod-vendor:
67
67
test :
68
68
go test -coverprofile coverage.out ` go list ./... | egrep -v ' (test|mocks|ext/)' `
69
69
70
+
71
+ .PHONY : test-race
70
72
test-race :
71
73
go test -race -coverprofile coverage.out ` go list ./... | egrep -v ' (test|mocks|ext/)' `
72
74
75
+ .PHONY : test-manifests
76
+ test-manifests :
77
+ ./scripts/test_manifests.sh
78
+
79
+
73
80
.PHONY : prereq
74
81
prereq :
75
82
mkdir -p dist
@@ -143,7 +150,7 @@ run-test:
143
150
--argocd-server-addr $(ARGOCD_SERVER ) \
144
151
--grpc-web
145
152
146
-
147
153
.PHONY : serve-docs
148
154
serve-docs :
149
- docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR} :/docs ${MKDOCS_DOCKER_IMAGE} serve -a 0.0.0.0:8000
155
+ docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR} :/docs ${MKDOCS_DOCKER_IMAGE} serve -a 0.0.0.0:8000
156
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+
4
+ kubeconform -v > /dev/null 2>&1
5
+ if [ $? -ne 0 ]; then
6
+ echo " Error: 'kubeconform' is not installed."
7
+ exit 1
8
+ fi
9
+
10
+
11
+ kubeconform \
12
+ -schema-location default \
13
+ -schema-location ' https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/kustomize.toolkit.fluxcd.io/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
14
+ -strict \
15
+ -verbose \
16
+ -summary \
17
+ ${MANIFESTS_DIRECTORY:- " manifests" }
18
+
You can’t perform that action at this time.
0 commit comments