diff --git a/.github/workflows/jan-electron-linter-and-test.yml b/.github/workflows/jan-electron-linter-and-test.yml index dd3656101..d4689ca60 100644 --- a/.github/workflows/jan-electron-linter-and-test.yml +++ b/.github/workflows/jan-electron-linter-and-test.yml @@ -14,6 +14,7 @@ on: - "core/**" - "extensions/**" - "!README.md" + - "Makefile" pull_request: branches: @@ -26,6 +27,7 @@ on: - "package.json" - "node_modules/**" - "yarn.lock" + - "Makefile" jobs: test-on-macos: diff --git a/Makefile b/Makefile index 13618cf6a..cb70715d5 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,18 @@ endif yarn install yarn build:extensions -dev: install-and-build +check-file-counts: install-and-build +ifeq ($(OS),Windows_NT) + powershell -Command "$$tgz_count = (Get-ChildItem -Path electron/pre-install -Filter *.tgz | Measure-Object | Select-Object -ExpandProperty Count); $$dir_count = (Get-ChildItem -Path extensions -Directory | Measure-Object | Select-Object -ExpandProperty Count); if ($$tgz_count -ne $$dir_count) { Write-Host 'Number of .tgz files in electron/pre-install (' + $$tgz_count + ') does not match the number of subdirectories in extension (' + $$dir_count + ')'; exit 1 } else { Write-Host 'Extension build successful' }" +else + @tgz_count=$$(find electron/pre-install -type f -name "*.tgz" | wc -l); dir_count=$$(find extensions -mindepth 1 -maxdepth 1 -type d | wc -l); if [ $$tgz_count -ne $$dir_count ]; then echo "Number of .tgz files in electron/pre-install ($$tgz_count) does not match the number of subdirectories in extension ($$dir_count)"; exit 1; else echo "Extension build successful"; fi +endif + +dev: check-file-counts yarn dev # Linting -lint: install-and-build +lint: check-file-counts yarn lint # Testing @@ -34,11 +41,11 @@ test: lint yarn test # Builds and publishes the app -build-and-publish: install-and-build +build-and-publish: check-file-counts yarn build:publish # Build -build: install-and-build +build: check-file-counts yarn build clean: