-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathjustfile
98 lines (80 loc) · 2.89 KB
/
justfile
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
set ignore-comments
VERSION := `./ci/build_scripts/version.sh 2>/dev/null || exit 0`
# Detect the default target based on the user's CPU arch.
# For MacOS m1 users, it will return a linux host but
# match the appropriate CPU architecture,
# e.g. MacOS m1 => "aarch64-unknown-linux-musl"
DEFAULT_TARGET := `./ci/build_scripts/detect_target.sh`
CARGO := `command -V cargo-zigbuild >/dev/null 2>&1 && printf "cargo-zigbuild" || printf "cargo"`
# Print project and host machine info
info:
@echo "OS: {{os()}}"
@echo "OS_FAMILY: {{os_family()}}"
@echo "HOST_ARCH: {{arch()}}"
@echo "VERSION: {{VERSION}}"
@echo "DEFAULT_TARGET: {{DEFAULT_TARGET}}"
# Default recipe
[private]
default:
@just --list
# Install necessary tools
install-tools:
rustup component add rustfmt --toolchain nightly
cargo install cargo-sort cargo-nextest
# Check if necessary tools are installed
[private]
check-tools:
#!/usr/bin/env bash
if ! cargo +nightly fmt --help &> /dev/null; then
echo "cargo +nightly fmt is not installed, use just install-tools or install it manually"
exit 1
fi
if ! cargo sort --help &> /dev/null; then
echo "cargo sort is not installed, use just install-tools or install it manually"
exit 1
fi
# Format code
format: check-tools
cargo +nightly fmt
cargo sort -w .
# Check code formatting
format-check: check-tools
cargo +nightly fmt -- --check
cargo sort -w . --check
# Check code
check TARGET=DEFAULT_TARGET:
{{CARGO}} check --target {{TARGET}}
{{CARGO}} clippy --all-targets --all-features --target {{TARGET}}
# Release, building all binaries and debian packages
release *ARGS:
ci/build_scripts/build.sh {{ARGS}}
# Run unit tests
test:
cargo nextest run --no-fail-fast --all-features --all-targets
cargo test --doc --no-fail-fast --all-features
# Install integration test dependencies
setup-integration-test *ARGS:
tests/RobotFramework/bin/setup.sh {{ARGS}}
# Run integration tests (using local build)
integration-test *ARGS: release
#!/usr/bin/env bash
set -e
if [ ! -d tests/RobotFramework/.venv ]; then
just -f {{justfile()}} setup-integration-test
fi
cd tests/RobotFramework
source .venv/bin/activate
invoke build --local
invoke tests {{ARGS}}
# Generate linux package scripts from templates
generate-linux-package-scripts:
./configuration/package_scripts/generate.py
# Build linux virtual packages
release-linux-virtual:
./ci/build_scripts/package.sh build_virtual "all" --output target/virtual-packages
# Publish linux virtual packages
publish-linux-virtual *ARGS='':
./ci/build_scripts/publish_packages.sh --path target/virtual-packages {{ARGS}}
# Publish linux packages for a specific target
publish-linux-target TARGET=DEFAULT_TARGET *ARGS='':
./ci/build_scripts/publish_packages.sh --path "target/{{TARGET}}/packages" {{ARGS}}