-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (61 loc) · 1.68 KB
/
Makefile
File metadata and controls
80 lines (61 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright The KCL Authors. All rights reserved.
PROJECT_NAME = kcl
PWD:=$(shell pwd)
# ----------------
# Build
# ----------------
.PHONY: build
build:
${PWD}/scripts/build.sh
.PHONY: build-wasm
build-wasm:
RUSTFLAGS="-Cpanic=abort -Cllvm-args=-wasm-use-legacy-eh=false" cargo build --target=wasm32-wasip1 --release
.PHONY: build-lsp
build-lsp:
cargo build --release --manifest-path crates/tools/src/LSP/Cargo.toml
.PHONY: build-cli
build-cli:
cargo build --release --manifest-path crates/cli/Cargo.toml
.PHONY: release
release:
${PWD}/scripts/release.sh
.PHONY: check
check:
cargo check -r --all
.PHONY: fmt
fmt:
cargo fmt --all
# Cargo clippy all packages
.PHONY: lint
lint:
cargo clippy
# Cargo clippy all packages
.PHONY: lint-all
lint-all:
cargo clippy --workspace --all-features --benches --examples --tests
# Cargo clippy all packages witj auto fix
.PHONY: fix
fix:
cargo clippy --fix --allow-dirty
# Generate runtime libraries when the runtime code is changed.
gen-runtime-api:
make -C crates/runtime gen-api-spec
make fmt
# Install the wasm-wasi target
install-rustc-wasm-wasi:
rustup target add wasm32-wasip1
# Install python3 pytest
install-test-deps:
python3 -m pip install --user -U pytest pytest-html pytest-xdist ruamel.yaml
# ------------------------
# Tests
# ------------------------
# Unit tests without code cov
test:
cargo test --workspace -r -- --nocapture
# Test runtime libaries using python functions
test-runtime: install-test-deps
cd tests/runtime && PYTHONPATH=. python3 -m pytest -vv || { echo 'runtime test failed' ; exit 1; }
# E2E grammar tests with the fast evaluator
test-grammar: install-test-deps
cd tests/grammar && python3 -m pytest -v -n 5