ci: Fix sccache by removing --depth 1 shallow clones and --features chat
All checks were successful
BotServer CI/CD / build (push) Successful in 48s
All checks were successful
BotServer CI/CD / build (push) Successful in 48s
- Remove --depth 1 from git clones (breaks sccache fingerprints) - Remove --features chat (already in default features) - Use git pull instead of fetch+checkout for incremental updates - Properly restart sccache server between builds - Ensure target directory persists across builds
This commit is contained in:
parent
6ec82c27a6
commit
c0c06e92eb
1 changed files with 19 additions and 10 deletions
|
|
@ -28,28 +28,30 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir -p $WORKSPACE
|
mkdir -p $WORKSPACE
|
||||||
cd $WORKSPACE
|
cd $WORKSPACE
|
||||||
# Update or clone botlib
|
# Update or clone botlib (preserve git history for sccache fingerprints)
|
||||||
if [ -d botlib/.git ]; then
|
if [ -d botlib/.git ]; then
|
||||||
git -C botlib fetch --depth 1 origin main && git -C botlib checkout FETCH_HEAD
|
git -C botlib pull origin main
|
||||||
else
|
else
|
||||||
git clone --depth 1 --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
|
||||||
# Update or clone botserver
|
# Update or clone botserver (preserve git history for sccache fingerprints)
|
||||||
if [ -d botserver/.git ]; then
|
if [ -d botserver/.git ]; then
|
||||||
git -C botserver fetch --depth 1 origin main && git -C botserver checkout FETCH_HEAD
|
git -C botserver pull origin main
|
||||||
else
|
else
|
||||||
git clone --depth 1 --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 and strip unused members
|
# Get workspace Cargo.toml from gb and strip unused members
|
||||||
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 --depth 1 origin main && git -C /opt/gbo/data/gb-ws checkout FETCH_HEAD
|
git -C /opt/gbo/data/gb-ws pull origin main
|
||||||
else
|
else
|
||||||
git clone --depth 1 --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
|
||||||
cp /opt/gbo/data/gb-ws/Cargo.toml Cargo.toml
|
cp /opt/gbo/data/gb-ws/Cargo.toml Cargo.toml
|
||||||
for m in botapp botdevice bottest botui botbook botmodels botplugin bottemplates; do
|
for m in botapp botdevice bottest botui botbook botmodels botplugin bottemplates; do
|
||||||
grep -v "\"$m\"" Cargo.toml > /tmp/c.toml && mv /tmp/c.toml Cargo.toml
|
grep -v "\"$m\"" Cargo.toml > /tmp/c.toml && mv /tmp/c.toml Cargo.toml
|
||||||
done
|
done
|
||||||
|
# Ensure target dir exists
|
||||||
|
mkdir -p target
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -68,10 +70,17 @@ jobs:
|
||||||
- name: Build BotServer
|
- name: Build BotServer
|
||||||
working-directory: /opt/gbo/data/botserver
|
working-directory: /opt/gbo/data/botserver
|
||||||
run: |
|
run: |
|
||||||
sccache --start-server 2>/dev/null || true
|
export SCCACHE_IDLE_TIMEOUT=300
|
||||||
cargo build -p botserver --features chat -j 8 2>&1 | tee /tmp/build.log
|
export SCCACHE_CACHE_SIZE=10G
|
||||||
|
sccache --stop-server 2>/dev/null || true
|
||||||
|
sleep 1
|
||||||
|
sccache --start-server
|
||||||
|
cargo build -p botserver -j 8 2>&1 | tee /tmp/build.log
|
||||||
|
echo "=== sccache stats ==="
|
||||||
sccache --show-stats
|
sccache --show-stats
|
||||||
|
echo "=== Binary info ==="
|
||||||
ls -lh target/debug/botserver
|
ls -lh target/debug/botserver
|
||||||
|
stat -c '%y' target/debug/botserver
|
||||||
|
|
||||||
- name: Save build log
|
- name: Save build log
|
||||||
if: always()
|
if: always()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue