Skip to content

Commit

Permalink
Enhancements to Dependency Installation and App Testing (janhq#965)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Service Account <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent 9806851 commit 54f916d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/jan-electron-linter-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "core/**"
- "extensions/**"
- "!README.md"
- "Makefile"

pull_request:
branches:
Expand All @@ -26,6 +27,7 @@ on:
- "package.json"
- "node_modules/**"
- "yarn.lock"
- "Makefile"

jobs:
test-on-macos:
Expand Down
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 54f916d

Please sign in to comment.