chore: adds makefile target for embedded FS check (#2915)

This commit is contained in:
Luke Kingland 2025-07-03 15:14:55 +09:00 committed by GitHub
parent 879233d668
commit 96269d0308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -1,10 +1,10 @@
name: Func Embedded FS Test
name: Func Check Embedded FS
on: [pull_request]
jobs:
test:
name: Func Embedded FS Test
name: Func Check Embedded FS
strategy:
matrix:
os: ["ubuntu-latest"]
@ -14,7 +14,7 @@ jobs:
- uses: knative/actions/setup-go@main
- name: Check embedded templates content
run: |
if ! go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem; then
if ! make check-embedded-fs; then
echo "Content of templates directory and embedded FS (zz_filesystem_generated.go) doesn't match!"
echo "Consult https:.github.com/knative/func/blob/main/docs/CONTRIBUTING.md#templates ."
exit 1

View File

@ -133,6 +133,10 @@ presubmit-unit-tests: ## Run prow presubmit unit tests locally
##@ Templates
#############
.PHONY: check-embedded-fs
check-embedded-fs: ## Check the embedded templates FS
go test -run "^\QTestFileSystems\E$$/^\Qembedded\E$$" ./pkg/filesystem
# TODO: add linters for other templates
.PHONY: check-templates
check-templates: check-go check-rust ## Run template source code checks