Skip to content

Commit

Permalink
chore: disable app update on test (janhq#521)
Browse files Browse the repository at this point in the history
* chore: disable app update on test

* chore: add build:test step

* Update CI test uses yarn build:test

* Plugin pull from npm registry instead of rebuild
---------

Co-authored-by: Hien To <[email protected]>
  • Loading branch information
louis-jan and hientominh authored Nov 1, 2023
1 parent 46739cb commit f02f769
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/jan-electron-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install yarn dependencies
run: |
yarn install
yarn build:plugins-darwin
yarn build:pull-plugins
env:
APP_PATH: "."
DEVELOPER_ID: ${{ secrets.DEVELOPER_ID }}
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
run: |
yarn config set network-timeout 300000
yarn install
yarn build:plugins
yarn build:pull-plugins
- name: Build and publish app
run: |
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
run: |
yarn config set network-timeout 300000
yarn install
yarn build:plugins
yarn build:pull-plugins
- name: Build and publish app
run: |
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/jan-electron-linter-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
yarn config set network-timeout 300000
yarn install
yarn lint
yarn build:plugins
yarn build
yarn build:pull-plugins
yarn build:test
yarn test
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"
Expand Down Expand Up @@ -76,9 +76,8 @@ jobs:
run: |
yarn config set network-timeout 300000
yarn install
yarn lint
yarn build:plugins
yarn build:win32
yarn build:pull-plugins
yarn build:test-win32
yarn test
test-on-ubuntu:
Expand All @@ -105,7 +104,6 @@ jobs:
echo -e "Display ID: $DISPLAY"
yarn config set network-timeout 300000
yarn install
yarn lint
yarn build:plugins
yarn build:linux
yarn build:pull-plugins
yarn build:test-linux
yarn test
4 changes: 3 additions & 1 deletion electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ function handleAppUpdates() {
});
autoUpdater.autoDownload = false;
autoUpdater.autoInstallOnAppQuit = true;
autoUpdater.checkForUpdates();
if (process.env.CI !== "e2e") {
autoUpdater.checkForUpdates();
}
}

/**
Expand Down
4 changes: 4 additions & 0 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
"test:e2e": "playwright test --workers=1",
"dev": "tsc -p . && electron .",
"build": "tsc -p . && electron-builder -p never -m",
"build:test": "tsc -p . && electron-builder --dir -p never -m",
"build:test-darwin": "tsc -p . && electron-builder -p never -m --x64 --arm64 --dir",
"build:test-win32": "tsc -p . && electron-builder -p never -w --dir",
"build:test-linux": "tsc -p . && electron-builder -p never -l --dir",
"build:darwin": "tsc -p . && electron-builder -p never -m --x64 --arm64",
"build:win32": "tsc -p . && electron-builder -p never -w",
"build:linux": "tsc -p . && electron-builder -p never --linux deb",
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
"dev:electron": "yarn workspace jan dev",
"dev:web": "yarn workspace jan-web dev",
"dev": "concurrently --kill-others \"yarn dev:web\" \"wait-on http://localhost:3000 && yarn dev:electron\"",
"test-local": "yarn lint && yarn build && yarn test",
"test-local": "yarn lint && yarn build:test && yarn test",
"build:core": "cd core && yarn install && yarn run build",
"build:web": "yarn workspace jan-web build && cpx \"web/out/**\" \"electron/renderer/\"",
"build:electron": "yarn workspace jan build",
"build:electron:test": "yarn workspace jan build:test",
"build:pull-plugins": "rimraf ./electron/core/pre-install/*.tgz && cd ./electron/core/pre-install && npm pack @janhq/inference-plugin @janhq/data-plugin @janhq/model-management-plugin @janhq/monitoring-plugin",
"build:plugins": "rimraf ./electron/core/pre-install/*.tgz && concurrently --kill-others-on-fail \"cd ./plugins/data-plugin && npm install && npm run postinstall\" \"cd ./plugins/inference-plugin && npm install && npm run postinstall\" \"cd ./plugins/model-management-plugin && npm install && npm run postinstall\" \"cd ./plugins/monitoring-plugin && npm install && npm run postinstall\" && concurrently --kill-others-on-fail \"cd ./plugins/data-plugin && npm run build:publish\" \"cd ./plugins/inference-plugin && npm run build:publish\" \"cd ./plugins/model-management-plugin && npm run build:publish\" \"cd ./plugins/monitoring-plugin && npm run build:publish\"",
"build:plugins-darwin": "rimraf ./electron/core/pre-install/*.tgz && concurrently \"cd ./plugins/data-plugin && npm install && npm run build:deps && npm run postinstall\" \"cd ./plugins/inference-plugin && npm install && npm run postinstall\" \"cd ./plugins/model-management-plugin && npm install && npm run postinstall\" \"cd ./plugins/monitoring-plugin && npm install && npm run postinstall\" && chmod +x ./.github/scripts/auto-sign.sh && ./.github/scripts/auto-sign.sh && concurrently \"cd ./plugins/data-plugin && npm run build:publish\" \"cd ./plugins/inference-plugin && npm run build:publish\" \"cd ./plugins/model-management-plugin && npm run build:publish\" \"cd ./plugins/monitoring-plugin && npm run build:publish\"",
"build": "yarn build:web && yarn build:electron",
"build:test": "yarn build:web && yarn build:electron:test",
"build:test-darwin": "yarn build:web && yarn workspace jan build:test-darwin",
"build:test-win32": "yarn build:web && yarn workspace jan build:test-win32",
"build:test-linux": "yarn build:web && yarn workspace jan build:test-linux",
"build:darwin": "yarn build:web && yarn workspace jan build:darwin",
"build:win32": "yarn build:web && yarn workspace jan build:win32",
"build:linux": "yarn build:web && yarn workspace jan build:linux",
Expand Down

0 comments on commit f02f769

Please sign in to comment.