diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-23 03:51:44 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-23 03:51:44 +0800 |
| commit | ab3e1867bf54f6dbb10b80aac159ad52303166a3 (patch) | |
| tree | 46a0f8123eecd3e61825b7a043036575057ae0f9 /deploy.sh | |
| parent | 25eb411a2e4c4207fbd8111e68a520ff20cbda73 (diff) | |
Add pre-build validation to deployment scripts
Diffstat (limited to 'deploy.sh')
| -rwxr-xr-x | deploy.sh | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -5,6 +5,27 @@ # Change to the directory where the script is located cd "$(dirname "$0")" || exit 1 +# Test core library +cargo test --manifest-path ../VersionControl/Cargo.toml --workspace +if [ $? -ne 0 ]; then + echo "Core library tests failed. Aborting build." + exit 1 +fi + +# Test workspace +cargo test --workspace +if [ $? -ne 0 ]; then + echo "Workspace tests failed. Aborting build." + exit 1 +fi + +# Check if git worktree is clean +git_status=$(git status --porcelain) +if [ -n "$git_status" ]; then + echo "Git worktree is not clean. Commit or stash changes before building." + exit 1 +fi + # Build if FORCE_BUILD=$(date +%s) cargo build --workspace --release; then # Export |
