File tree 5 files changed +55
-2
lines changed
5 files changed +55
-2
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,40 @@ jobs:
67
67
set -e
68
68
make e2e-tests
69
69
70
+ e2e-test-ko :
71
+ runs-on : ubuntu-latest
72
+ steps :
73
+ - name : Checkout
74
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
75
+ - name : Setup Go
76
+ uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
77
+ with :
78
+ go-version-file : go.mod
79
+ cache-dependency-path : go.sum
80
+ - name : Install ko
81
+ uses : imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
82
+ with :
83
+ version : v0.15.1
84
+ - name : Build Docker image locally with ko
85
+ run : |
86
+ set -e
87
+ make build-ko
88
+ env :
89
+ KO_DOCKER_REPO : ko.local
90
+ - name : Create test cluster
91
+ run : |
92
+ set -e
93
+ make kind-cluster
94
+ - name : Run tests
95
+ run : |
96
+ set -e
97
+ make e2e-tests-ko
98
+
70
99
required :
71
100
needs :
72
101
- unit-tests
73
102
- e2e-tests
103
+ - e2e-test-ko
74
104
runs-on : ubuntu-latest
75
105
steps :
76
106
- run : echo "Required jobs success!"
Original file line number Diff line number Diff line change
1
+ defaultBaseImage : cgr.dev/chainguard/kubectl:latest-dev
Original file line number Diff line number Diff line change @@ -219,6 +219,12 @@ $(CLI_BIN): fmt vet
219
219
220
220
build : $(CLI_BIN ) # # Build
221
221
222
+ .PHONY : build-ko
223
+ build-ko : # # Build Docker image with ko
224
+ @echo " Build Docker image with ko..." >&2
225
+ export KO_DOCKER_REPO=ko.local
226
+ ko build --base-import-paths main.go
227
+
222
228
# #######
223
229
# TEST #
224
230
# #######
@@ -234,7 +240,22 @@ e2e-tests: $(CLI_BIN) ## Run e2e tests
234
240
@echo Running e2e tests... >&2
235
241
@echo " foo: bar" | ./$(CLI_BIN ) test --test-dir ./testdata/e2e --config ./testdata/e2e/config.yaml --values -
236
242
237
- # #######
243
+ .PHONY : e2e-tests-ko
244
+ e2e-tests-ko :
245
+ @echo Running e2e tests in docker... >&2
246
+ @docker run \
247
+ -v ./testdata/e2e/:/chainsaw/ \
248
+ -v ${HOME} /.kube/:/etc/kubeconfig/ \
249
+ -e KUBECONFIG=/etc/kubeconfig/config \
250
+ --network=host \
251
+ --user $(id -u ) :$(id -g ) \
252
+ --name chainsaw \
253
+ --rm ko.local/main.go:latest \
254
+ test --test-dir /chainsaw \
255
+ --config /chainsaw/config.yaml \
256
+ --values /chainsaw/values.yaml
257
+
258
+ # #######
238
259
# KIND #
239
260
# #######
240
261
Original file line number Diff line number Diff line change 2
2
apiVersion : chainsaw.kyverno.io/v1alpha1
3
3
kind : Configuration
4
4
metadata :
5
- name : congiguration
5
+ name : configuration
6
6
spec :
7
7
fullName : true
8
8
failFast : true
Original file line number Diff line number Diff line change
1
+ foo : bar
You can’t perform that action at this time.
0 commit comments