-
Notifications
You must be signed in to change notification settings - Fork 254
185 lines (180 loc) · 5.65 KB
/
test.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: E2E Tests
permissions: {}
on:
workflow_dispatch: {}
pull_request:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
kuttl:
strategy:
fail-fast: false
matrix:
k8s-version:
- name: v1.25
version: v1.25.11
- name: v1.26
version: v1.26.6
- name: v1.27
version: v1.27.3
- name: v1.28
version: v1.28.0
tests:
- argo
- aws
- best-practices
- castai
# - cert-manager
- consul
- external-secret-operator
- flux
- istio
- karpenter
- kasten
- kubecost
- kubeops
- kubevirt
- linkerd
- nginx-ingress
- openshift
- other/a
- other/b-d
- other/e-l
- other/m-q
- other/rec-req
- other/res
- other/s-z
- pod-security
- pod-security-cel
- psa
- psp-migration
# - tekton
# - traefik
# - velero
runs-on: ubuntu-latest
name: kuttl - ${{ matrix.k8s-version.name }} - ${{ matrix.tests }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ~1.21.1
- name: Install Tools
run: |
GOBIN=$(pwd)/.tools/ go install sigs.k8s.io/[email protected]
GOBIN=$(pwd)/.tools/ go install github.com/kyverno/kuttl/cmd/kubectl-kuttl@main
curl -LO "https://dl.k8s.io/release/${{ matrix.k8s-version.version }}/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: Install latest Kyverno CLI
uses: kyverno/action-install-cli@fcee92fca5c883169ef9927acf543e0b5fc58289 # v0.2.0
- name: Create kind cluster
run: |
./.tools/kind create cluster --image kindest/node:${{ matrix.k8s-version.version }} --config ./.github/kind.yml
- name: Install latest kyverno
run: |
kubectl create -f https://github.com/kyverno/kyverno/raw/main/config/install-latest-testing.yaml
- name: Wait for kyverno ready
run: |
kubectl wait --namespace kyverno --for=condition=ready pod --selector '!job-name' --timeout=60s
- name: Install CRDs
run: |
set -e
kubectl apply -f ./CRDs
- name: Test with kuttl
run: |
./.tools/kubectl-kuttl test ./${{ matrix.tests }} --config ./kuttl-test.yaml
chainsaw:
strategy:
fail-fast: false
matrix:
k8s-version:
- name: v1.25
version: v1.25.11
- name: v1.26
version: v1.26.6
- name: v1.27
version: v1.27.3
- name: v1.28
version: v1.28.0
tests:
# - argo
# - aws
# - best-practices
# - castai
- cert-manager
# - consul
# - external-secret-operator
# - flux
# - istio
# - karpenter
# - kasten
# - kubecost
# - kubeops
# - kubevirt
# - linkerd
# - nginx-ingress
# - openshift
# - other/a
# - other/b-d
# - other/e-l
# - other/m-q
# - other/rec-req
# - other/res
# - other/s-z
# - pod-security
# - pod-security-cel
# - psa
# - psp-migration
# - tekton
# - traefik
# - velero
runs-on: ubuntu-latest
name: chainsaw - ${{ matrix.k8s-version.name }} - ${{ matrix.tests }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ~1.21.1
- name: Install Tools
run: |
set -e
GOBIN=$(pwd)/.tools/ go install sigs.k8s.io/[email protected]
curl -LO "https://dl.k8s.io/release/${{ matrix.k8s-version.version }}/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: Install latest Kyverno CLI
uses: kyverno/action-install-cli@fcee92fca5c883169ef9927acf543e0b5fc58289 # v0.2.0
- name: Create kind cluster
run: |
set -e
./.tools/kind create cluster --image kindest/node:${{ matrix.k8s-version.version }} --config ./.github/kind.yml
- name: Install latest kyverno
run: |
set -e
kubectl create -f https://github.com/kyverno/kyverno/raw/main/config/install-latest-testing.yaml
- name: Wait for kyverno ready
run: |
set -e
kubectl wait --namespace kyverno --for=condition=ready pod --selector '!job-name' --timeout=60s
- name: Install CRDs
run: |
set -e
kubectl apply -f ./CRDs
- name: Install Chainsaw
uses: kyverno/chainsaw/.github/actions/install@5ca138ff5ad87bfb2c41e52cde8c00154756e4c5 # v0.0.7
with:
release: v0.0.8-alpha.1
- name: Test with Chainsaw
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
chainsaw test --config .chainsaw.yaml --test-dir ./${{ matrix.tests }} --no-color=false
- name: Debug failure
if: failure()
uses: ./.github/actions/kyverno-logs