@@ -40,15 +40,15 @@ export GOFLAGS
40
40
41
41
MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
42
42
43
- .PHONY : test docs
44
-
45
43
# Default Targets
44
+ .PHONY : all
46
45
all : build docs
47
46
@echo ' 🎉 Build process completed!'
48
47
49
48
# Help Text
50
49
# Headings: lines with `##$` comment prefix
51
50
# Targets: printed if their line includes a `##` comment
51
+ .PHONY : help
52
52
help :
53
53
@echo ' Usage: make <OPTIONS> ... <TARGETS>'
54
54
@echo ' '
60
60
# #@ Development
61
61
# ##############
62
62
63
+ .PHONY : build
63
64
build : $(BIN ) # # (default) Build binary for current OS
64
65
65
66
.PHONY : $(BIN )
@@ -123,6 +124,7 @@ docs:
123
124
# #@ Prow Integration
124
125
# ############
125
126
127
+ .PHONY : presubmit-unit-tests
126
128
presubmit-unit-tests : # # Run prow presubmit unit tests locally
127
129
docker run --platform linux/amd64 -it --rm -v$(MAKEFILE_DIR ) :/src/ us-docker.pkg.dev/knative-tests/images/prow-tests:v20230616-086ddd644 sh -c ' cd /src && runner.sh ./test/presubmit-tests.sh --unit-tests'
128
130
@@ -147,31 +149,39 @@ check-rust: ## Check Rust templates' source
147
149
cd templates/rust/cloudevents && cargo clippy && cargo clean
148
150
cd templates/rust/http && cargo clippy && cargo clean
149
151
152
+ .PHONY : test-templates
150
153
test-templates : test-go test-node test-python test-quarkus test-springboot test-rust test-typescript # # Run all template tests
151
154
155
+ .PHONY : test-go
152
156
test-go : # # Test Go templates
153
157
cd templates/go/cloudevents && go mod tidy && go test
154
158
cd templates/go/http && go mod tidy && go test
155
159
160
+ .PHONY : test-node
156
161
test-node : # # Test Node templates
157
162
cd templates/node/cloudevents && npm ci && npm test && rm -rf node_modules
158
163
cd templates/node/http && npm ci && npm test && rm -rf node_modules
159
164
165
+ .PHONY : test-python
160
166
test-python : # # Test Python templates and Scaffolding
161
167
test/test_python.sh
162
168
169
+ .PHONY : test-quarkus
163
170
test-quarkus : # # Test Quarkus templates
164
171
cd templates/quarkus/cloudevents && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
165
172
cd templates/quarkus/http && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
166
173
174
+ .PHONY : test-springboot
167
175
test-springboot : # # Test Spring Boot templates
168
176
cd templates/springboot/cloudevents && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
169
177
cd templates/springboot/http && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
170
178
179
+ .PHONY : test-rust
171
180
test-rust : # # Test Rust templates
172
181
cd templates/rust/cloudevents && cargo -q test && cargo clean
173
182
cd templates/rust/http && cargo -q test && cargo clean
174
183
184
+ .PHONY : test-typescript
175
185
test-typescript : # # Test Typescript templates
176
186
cd templates/typescript/cloudevents && npm ci && npm test && rm -rf node_modules build
177
187
cd templates/typescript/http && npm ci && npm test && rm -rf node_modules build
@@ -181,16 +191,18 @@ test-typescript: ## Test Typescript templates
181
191
# ##############
182
192
183
193
# Pulls runtimes then rebuilds the embedded filesystem
194
+ .PHONY : update-runtimes
184
195
update-runtimes : update-runtime-go generate/zz_filesystem_generated.go # # Update Scaffolding Runtimes
185
196
197
+ .PHONY : update-runtime-go
186
198
update-runtime-go :
187
199
cd templates/go/scaffolding/instanced-http && go get -u knative.dev/func-go/http
188
200
cd templates/go/scaffolding/static-http && go get -u knative.dev/func-go/http
189
201
cd templates/go/scaffolding/instanced-cloudevents && go get -u knative.dev/func-go/cloudevents
190
202
cd templates/go/scaffolding/static-cloudevents && go get -u knative.dev/func-go/cloudevents
191
203
192
204
193
- .PHONY : cert
205
+ .PHONY : certs
194
206
certs : templates/certs/ca-certificates.crt # # Update root certificates
195
207
196
208
.PHONY : templates/certs/ca-certificates.crt
@@ -202,59 +214,70 @@ templates/certs/ca-certificates.crt:
202
214
# #@ Extended Testing (cluster required)
203
215
# ##################
204
216
217
+ .PHONY : test-integration
205
218
test-integration : # # Run integration tests using an available cluster.
206
219
go test -tags integration -timeout 30m --coverprofile=coverage.txt ./... -v
207
220
208
221
.PHONY : func-instrumented
209
-
210
222
func-instrumented : # # Func binary that is instrumented for e2e tests
211
223
env CGO_ENABLED=1 go build -cover -o func ./cmd/$(BIN )
212
224
225
+ .PHONY : test-e2e
213
226
test-e2e : func-instrumented # # Run end-to-end tests using an available cluster.
214
227
./test/e2e_extended_tests.sh
215
228
229
+ .PHONY : test-e2e-runtime
216
230
test-e2e-runtime : func-instrumented # # Run end-to-end lifecycle tests using an available cluster for a single runtime.
217
231
./test/e2e_lifecycle_tests.sh $(runtime )
218
232
233
+ .PHONY : test-e2e-on-cluster
219
234
test-e2e-on-cluster : func-instrumented # # Run end-to-end on-cluster build tests using an available cluster.
220
235
./test/e2e_oncluster_tests.sh
221
236
222
237
# #####################
223
238
# #@ Release Artifacts
224
239
# #####################
225
240
241
+ .PHONY : cross-platform
226
242
cross-platform : darwin-arm64 darwin-amd64 linux-amd64 linux-arm64 linux-ppc64le linux-s390x windows # # Build all distributable (cross-platform) binaries
227
243
244
+ .PHONY : darwin-arm64
228
245
darwin-arm64 : $(BIN_DARWIN_ARM64 ) # # Build for mac M1
229
246
230
247
$(BIN_DARWIN_ARM64 ) : generate/zz_filesystem_generated.go
231
248
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BIN_DARWIN_ARM64 ) -trimpath -ldflags " $( LDFLAGS) -w -s" ./cmd/$(BIN )
232
249
250
+ .PHONY : darwn-amd64
233
251
darwin-amd64 : $(BIN_DARWIN_AMD64 ) # # Build for Darwin (macOS)
234
252
235
253
$(BIN_DARWIN_AMD64 ) : generate/zz_filesystem_generated.go
236
254
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(BIN_DARWIN_AMD64 ) -trimpath -ldflags " $( LDFLAGS) -w -s" ./cmd/$(BIN )
237
255
256
+ .PHONY : linux-amd64
238
257
linux-amd64 : $(BIN_LINUX_AMD64 ) # # Build for Linux amd64
239
258
240
259
$(BIN_LINUX_AMD64 ) : generate/zz_filesystem_generated.go
241
260
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BIN_LINUX_AMD64 ) -trimpath -ldflags " $( LDFLAGS) -w -s" ./cmd/$(BIN )
242
261
262
+ .PHONY : linux-arm64
243
263
linux-arm64 : $(BIN_LINUX_ARM64 ) # # Build for Linux arm64
244
264
245
265
$(BIN_LINUX_ARM64 ) : generate/zz_filesystem_generated.go
246
266
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BIN_LINUX_ARM64 ) -trimpath -ldflags " $( LDFLAGS) -w -s" ./cmd/$(BIN )
247
267
268
+ .PHONY : linux-ppc64le
248
269
linux-ppc64le : $(BIN_LINUX_PPC64LE ) # # Build for Linux ppc64le
249
270
250
271
$(BIN_LINUX_PPC64LE ) : generate/zz_filesystem_generated.go
251
272
env CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o $(BIN_LINUX_PPC64LE ) -trimpath -ldflags " $( LDFLAGS) -w -s" ./cmd/$(BIN )
252
273
274
+ .PHONY : linux-s390x
253
275
linux-s390x : $(BIN_LINUX_S390X ) # # Build for Linux s390x
254
276
255
277
$(BIN_LINUX_S390X ) : generate/zz_filesystem_generated.go
256
278
env CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o $(BIN_LINUX_S390X ) -trimpath -ldflags " $( LDFLAGS) -w -s" ./cmd/$(BIN )
257
279
280
+ .PHONY : windows
258
281
windows : $(BIN_WINDOWS ) # # Build for Windows
259
282
260
283
$(BIN_WINDOWS ) : generate/zz_filesystem_generated.go
@@ -264,10 +287,12 @@ $(BIN_WINDOWS): generate/zz_filesystem_generated.go
264
287
# #@ Schemas
265
288
# #####################
266
289
290
+ .PHONY : schema-generate
267
291
schema-generate : schema/func_yaml-schema.json # # Generate func.yaml schema
268
292
schema/func_yaml-schema.json : pkg/functions/function.go pkg/functions/function_* .go
269
293
go run schema/generator/main.go
270
294
295
+ .PHONY : schema-check
271
296
schema-check : # # Check that func.yaml schema is up-to-date
272
297
mv schema/func_yaml-schema.json schema/func_yaml-schema-previous.json
273
298
make schema-generate
0 commit comments