Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

perf(ci): stop make test compiling release binaries

Minh141120cf33d851efd7
diff --git a/.github/workflows/jan-linter-and-test.yml b/.github/workflows/jan-linter-and-test.yml
index b26dd1660..6d6ea5765 100644
--- a/.github/workflows/jan-linter-and-test.yml
+++ b/.github/workflows/jan-linter-and-test.yml
@@ -150,7 +150,7 @@ jobs:
- name: Linter and test
run: |
- make test
+ make test-ci
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
@@ -233,7 +233,7 @@ jobs:
- name: Linter and test
shell: powershell
run: |
- make test
+ make test-ci
env:
NODE_OPTIONS: '--max-old-space-size=2048'
@@ -271,7 +271,8 @@ jobs:
run: |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
echo -e "Display ID: $DISPLAY"
- make test
+ make test-ci
+ make check-cli
coverage-check:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
diff --git a/Makefile b/Makefile
index 570bdf9f7..479c33ea4 100644
--- a/Makefile
+++ b/Makefile
@@ -121,20 +121,37 @@ lint: install-and-build
yarn lint
# Testing
-test: lint install-rust-targets
+#
+# `test` is the full local suite and is unchanged: it still builds the real MLX
+# server and CLI binary. `test-ci` runs the same suites without those release
+# builds -- neither is a declared Tauri resource or externalBin (bundle.resources
+# is only resources/LICENSE) and no test executes them, so in CI they were just
+# duplicating what `make build` already does on the release path.
+test-prepare: lint
yarn download:bin
-ifeq ($(DETECTED_OS),Windows)
-endif
yarn test
yarn copy:assets:tauri
yarn build:icon
- yarn build:mlx-server
- make build-cli
+
+test-rust:
cargo test --locked --manifest-path src-tauri/Cargo.toml --no-default-features --features test-tauri -- --test-threads=1
cargo test --locked --manifest-path src-tauri/plugins/tauri-plugin-hardware/Cargo.toml
cargo test --locked --manifest-path src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml
cargo test --locked --manifest-path src-tauri/utils/Cargo.toml
+test: test-prepare install-rust-targets
+ yarn build:mlx-server
+ make build-cli
+ make test-rust
+
+test-ci: test-prepare
+ make test-rust
+
+# Cheap compile guard for the CLI feature set, covering what test-ci no longer
+# builds. `make build` still builds the real binary on every platform.
+check-cli:
+ cd src-tauri && cargo check --locked --features cli --bin jan-cli
+
# Build MLX server (macOS Apple Silicon only) - always builds
build-mlx-server:
ifeq ($(DETECTED_OS),Darwin)