From 0d6921c38d60f01ed727d264a5165a921b8fc64d Mon Sep 17 00:00:00 2001 From: Christian Meffert Date: Sun, 19 Jan 2025 18:15:29 +0000 Subject: [PATCH] [ci] Add check for webui sorurce files in dist Checks with "make web-check" that all web ui source files are distributed as part of the release tar. --- .github/workflows/ubuntu.yml | 1 + Makefile.am | 2 ++ web-src/Makefile.am | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ddb71bc9b9..1fad592732 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -36,6 +36,7 @@ jobs: make make check make distcheck + make web-check - name: Install run: | diff --git a/Makefile.am b/Makefile.am index 43efd0f2f2..41dbc90cb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -120,6 +120,8 @@ web-update: $(MAKE) web-update -C web-src web-serve: $(MAKE) web-serve -C web-src +web-check: + $(MAKE) web-check -C web-src web-lint: $(MAKE) web-lint -C web-src web-format: diff --git a/web-src/Makefile.am b/web-src/Makefile.am index 2f0eb4fe1b..dad58aa7b8 100644 --- a/web-src/Makefile.am +++ b/web-src/Makefile.am @@ -191,8 +191,24 @@ web-serve: node_modules web-update: $(if $(NPM),$(NPM) update) +web-check: + @echo "Verifying that all source files in 'src' and 'public' are listed in WEB_FILES ..." + @unexpected_files=0; \ + for file in $$(find public src -type f); do \ + if ! echo " $(WEB_FILES) " | grep -q " $$file "; then \ + echo "Unknown web interface source file found: $$file"; \ + unexpected_files=1; \ + fi; \ + done; \ + if [ $$unexpected_files -eq 0 ]; then \ + echo "All source files listed in WEB_FILES."; \ + else \ + echo "FAILURE: Unknown web interface source files found, please add them to WEB_FILES."; \ + exit 1; \ + fi + web-lint: node_modules - $(if $(NPM),$(NPM) run lint) + $(if $(NPM),$(NPM) run lint --no-fix) web-format: node_modules $(if $(NPM),$(NPM) run format)