From 96269d03086cead4e42f222b2a65dcaa8b4eb5d0 Mon Sep 17 00:00:00 2001 From: Luke Kingland Date: Thu, 3 Jul 2025 15:14:55 +0900 Subject: [PATCH] chore: adds makefile target for embedded FS check (#2915) --- .github/workflows/test-embedded-fs.yaml | 6 +++--- Makefile | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-embedded-fs.yaml b/.github/workflows/test-embedded-fs.yaml index ad0461214..47e62b995 100644 --- a/.github/workflows/test-embedded-fs.yaml +++ b/.github/workflows/test-embedded-fs.yaml @@ -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 diff --git a/Makefile b/Makefile index 27c94f2ff..bf822f03b 100644 --- a/Makefile +++ b/Makefile @@ -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