ci: simplify - always build, rely on sccache for speed
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
This commit is contained in:
parent
768a3f6f82
commit
db1dd37adc
1 changed files with 6 additions and 42 deletions
|
|
@ -29,19 +29,12 @@ jobs:
|
||||||
mkdir -p $WORKSPACE
|
mkdir -p $WORKSPACE
|
||||||
cd $WORKSPACE
|
cd $WORKSPACE
|
||||||
|
|
||||||
# Fetch latest changes first
|
echo "=== Updating workspace ==="
|
||||||
echo "=== Checking for updates ==="
|
|
||||||
|
|
||||||
# Update or clone botlib
|
# Update or clone botlib
|
||||||
if [ -d botlib/.git ]; then
|
if [ -d botlib/.git ]; then
|
||||||
echo "Updating botlib..."
|
echo "Updating botlib..."
|
||||||
git -C botlib fetch origin main
|
git -C botlib pull --ff-only origin main || git -C botlib fetch origin main
|
||||||
if ! git -C botlib diff origin/main --quiet 2>/dev/null; then
|
|
||||||
echo "botlib has changes, pulling..."
|
|
||||||
git -C botlib pull --ff-only origin main
|
|
||||||
else
|
|
||||||
echo "botlib up to date"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git botlib
|
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git botlib
|
||||||
fi
|
fi
|
||||||
|
|
@ -49,26 +42,14 @@ jobs:
|
||||||
# Update or clone botserver
|
# Update or clone botserver
|
||||||
if [ -d botserver/.git ]; then
|
if [ -d botserver/.git ]; then
|
||||||
echo "Updating botserver..."
|
echo "Updating botserver..."
|
||||||
git -C botserver fetch origin main
|
git -C botserver pull --ff-only origin main || git -C botserver fetch origin main
|
||||||
if ! git -C botserver diff origin/main --quiet 2>/dev/null; then
|
|
||||||
echo "botserver has changes, pulling..."
|
|
||||||
git -C botserver pull --ff-only origin main
|
|
||||||
else
|
|
||||||
echo "botserver up to date"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver
|
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get workspace Cargo.toml from gb
|
# Get workspace Cargo.toml from gb
|
||||||
if [ -d /opt/gbo/data/gb-ws/.git ]; then
|
if [ -d /opt/gbo/data/gb-ws/.git ]; then
|
||||||
git -C /opt/gbo/data/gb-ws fetch origin main
|
git -C /opt/gbo/data/gb-ws pull --ff-only origin main || git -C /opt/gbo/data/gb-ws fetch origin main
|
||||||
if ! git -C /opt/gbo/data/gb-ws diff origin/main --quiet 2>/dev/null; then
|
|
||||||
echo "gb-ws has changes, pulling..."
|
|
||||||
git -C /opt/gbo/data/gb-ws pull --ff-only origin main
|
|
||||||
else
|
|
||||||
echo "gb-ws up to date"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git /opt/gbo/data/gb-ws
|
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git /opt/gbo/data/gb-ws
|
||||||
fi
|
fi
|
||||||
|
|
@ -118,25 +99,8 @@ jobs:
|
||||||
sleep 1
|
sleep 1
|
||||||
sccache --start-server
|
sccache --start-server
|
||||||
|
|
||||||
# Check if there are changes to rebuild (check botserver submodule)
|
# Always build - too complex to detect changes reliably
|
||||||
cd /opt/gbo/data/botserver/botserver
|
# sccache will handle caching efficiently
|
||||||
git fetch origin main
|
|
||||||
|
|
||||||
# Get current commit and origin/main commit
|
|
||||||
CURRENT_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "")
|
|
||||||
ORIGIN_COMMIT=$(git rev-parse origin/main 2>/dev/null || echo "")
|
|
||||||
echo "Current commit: $CURRENT_COMMIT"
|
|
||||||
echo "Origin commit: $ORIGIN_COMMIT"
|
|
||||||
|
|
||||||
# Compare commits - if different, there are changes to deploy
|
|
||||||
if [ "$CURRENT_COMMIT" = "$ORIGIN_COMMIT" ] && [ -f /opt/gbo/data/botserver/target/debug/botserver ]; then
|
|
||||||
echo "No changes - already at origin/main and binary exists, skipping build"
|
|
||||||
echo "=== sccache stats ==="
|
|
||||||
sccache --show-stats || true
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Changes detected or no binary - will build"
|
|
||||||
|
|
||||||
cd /opt/gbo/data/botserver
|
cd /opt/gbo/data/botserver
|
||||||
echo "=== Starting build in background ==="
|
echo "=== Starting build in background ==="
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue