From 09d64357180e0797b8dcdcaf14b4d3a634effc29 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 21 Mar 2026 21:33:47 +0800 Subject: Keep compile_info.rs in git and reorder deploy checks Remove compile_info.rs from .gitignore to keep it in version control, preventing test failures when the template hasn't been processed yet. Also reorder deployment script checks to verify git status before running tests, ensuring a clean state before testing begins. --- scripts/dev/deploy.ps1 | 32 ++++++++++++++++---------------- scripts/dev/deploy.sh | 32 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'scripts/dev') diff --git a/scripts/dev/deploy.ps1 b/scripts/dev/deploy.ps1 index 5332f1d..9774b75 100644 --- a/scripts/dev/deploy.ps1 +++ b/scripts/dev/deploy.ps1 @@ -35,22 +35,6 @@ if (-not (Test-Path $coreLibPath)) { exit 1 } -# Test core library -Write-Host "Testing Core Library `".\..\VersionControl\Cargo.toml`"" -cargo test --manifest-path ..\VersionControl\Cargo.toml --workspace --quiet > $null 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Warning "Core library tests failed. Aborting build." - exit 1 -} - -# Test workspace -Write-Host "Testing Command Line `".\Cargo.toml`"" -cargo test --workspace --quiet > $null 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Warning "Workspace tests failed. Aborting build." - exit 1 -} - # Check if main git worktree is clean $gitStatus = git status --porcelain if ($gitStatus) { @@ -67,6 +51,22 @@ if ($coreGitStatus) { exit 1 } +# Test core library +Write-Host "Testing Core Library `".\..\VersionControl\Cargo.toml`"" +cargo test --manifest-path ..\VersionControl\Cargo.toml --workspace --quiet > $null 2>&1 +if ($LASTEXITCODE -ne 0) { + Write-Warning "Core library tests failed. Aborting build." + exit 1 +} + +# Test workspace +Write-Host "Testing Command Line `".\Cargo.toml`"" +cargo test --workspace --quiet > $null 2>&1 +if ($LASTEXITCODE -ne 0) { + Write-Warning "Workspace tests failed. Aborting build." + exit 1 +} + # Build $env:FORCE_BUILD=$(Get-Date -Format 'mmss') Write-Host "Building Command Line `".\Cargo.toml`"" diff --git a/scripts/dev/deploy.sh b/scripts/dev/deploy.sh index 9ade49d..2bbf042 100755 --- a/scripts/dev/deploy.sh +++ b/scripts/dev/deploy.sh @@ -15,22 +15,6 @@ if [ ! -d "$coreLibPath" ]; then exit 1 fi -# Test core library -echo "Testing Core Library \"../VersionControl/Cargo.toml\"" -cargo test --manifest-path ../VersionControl/Cargo.toml --workspace --quiet > /dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "Core library tests failed. Aborting build." - exit 1 -fi - -# Test workspace -echo "Testing Command Line \"./Cargo.toml\"" -cargo test --workspace --quiet > /dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "Workspace tests failed. Aborting build." - exit 1 -fi - # Check if main git worktree is clean git_status=$(git status --porcelain) if [ -n "$git_status" ]; then @@ -47,6 +31,22 @@ if [ -n "$core_git_status" ]; then exit 1 fi +# Test core library +echo "Testing Core Library \"../VersionControl/Cargo.toml\"" +cargo test --manifest-path ../VersionControl/Cargo.toml --workspace --quiet > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "Core library tests failed. Aborting build." + exit 1 +fi + +# Test workspace +echo "Testing Command Line \"./Cargo.toml\"" +cargo test --workspace --quiet > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "Workspace tests failed. Aborting build." + exit 1 +fi + # Build echo "Building Command Line \"./Cargo.toml\"" if FORCE_BUILD=$(date +%s) cargo build --workspace --release --quiet > /dev/null 2>&1; then -- cgit