File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : kubeconform
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches : [main]
7
+ tags :
8
+ - " v[0-9]+.[0-9]+.[0-9]+*"
9
+
10
+ jobs :
11
+ get-test-matrix :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout repository
15
+ uses : actions/checkout@v4
16
+
17
+ - name : get matrix
18
+ id : test_matrix
19
+ run : |
20
+ echo "Getting test matrix"
21
+ matrix=`cat ci-matrix.json | jq '.kubeconform_tests' | jq -r 'tostring' | tr -d '\n'`
22
+ echo "matrix=${matrix}" >> $GITHUB_OUTPUT
23
+ outputs :
24
+ matrix : ${{ steps.test_matrix.outputs.matrix }}
25
+
26
+ kubeconform :
27
+ runs-on : ubuntu-latest
28
+ needs : get-test-matrix
29
+ strategy :
30
+ matrix : ${{ fromJSON(needs.get-test-matrix.outputs.matrix) }}
31
+ steps :
32
+ - uses : actions/checkout@v4
33
+
34
+ - name : Install kubeconform
35
+ run : |
36
+ curl -L -o kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz
37
+ tar -xzf kubeconform.tar.gz
38
+ sudo mv kubeconform /usr/local/bin/
39
+ echo "done"
40
+
41
+ - name : Run kubeconform on rendered examples
42
+ run : |
43
+ for dir in examples/*/; do
44
+ base_dir="$(basename "$dir")"
45
+ [[ "$base_dir" == "distribution-openshift" || "$base_dir" == *operator* ]] && continue
46
+ cmd="kubeconform -strict -schema-location default -output pretty -verbose -kubernetes-version ${{ matrix.k8s-version }} \"$dir\"/rendered_manifests"
47
+ if ! eval $cmd; then
48
+ echo "kubeconform version: $(kubeconform -v)"
49
+ echo "Failed command: $cmd"
50
+ exit 1
51
+ fi
52
+ done
Original file line number Diff line number Diff line change 43
43
" v1.26.6" ,
44
44
" v1.25.11"
45
45
]
46
+ },
47
+ "kubeconform_tests" : {
48
+ "k8s-version" : [
49
+ " 1.26.15" ,
50
+ " 1.27.15" ,
51
+ " 1.28.15" ,
52
+ " 1.29.15" ,
53
+ " 1.30.13" ,
54
+ " 1.31.9" ,
55
+ " 1.32.5" ,
56
+ " 1.33.1"
57
+ ]
46
58
}
47
59
}
You can’t perform that action at this time.
0 commit comments