Enhancements to Dependency Installation and App Testing (#965)

* Add check build extensions

* Correct Makefile check extenstions

* Add check build extensions

* Correct Makefile check extenstions

* Include Makefile change will run test

* Fix error on linux

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
Co-authored-by: Service Account <service@jan.ai>
This commit is contained in:
hiento09 2023-12-18 09:29:53 +07:00 committed by GitHub
parent 98068516ab
commit 54f916d3fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -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:

View File

@ -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: