Optimize CI Setup Workspace - avoid full codebase download
- Remove gb-ws clone (unnecessary intermediate step) - Use --depth 1 for shallow clones (only latest commit) - Create minimal Cargo.toml directly (only botlib + botserver members) - Use git pull --ff-only for updates (no full history) - Significantly reduces CI time and disk usage - Maintains single-pull strategy
This commit is contained in:
parent
26b009d4e6
commit
2634521d9e
1 changed files with 16 additions and 16 deletions
|
|
@ -29,29 +29,29 @@ jobs:
|
||||||
mkdir -p $WORKSPACE
|
mkdir -p $WORKSPACE
|
||||||
cd $WORKSPACE
|
cd $WORKSPACE
|
||||||
|
|
||||||
# Clone or update repos
|
# Create minimal Cargo.toml for building botserver only
|
||||||
|
cat > Cargo.toml << 'EOF'
|
||||||
|
[workspace]
|
||||||
|
members = ["botlib", "botserver"]
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
# Empty - all deps defined in member crates
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Clone or update botlib
|
||||||
if [ -d botlib/.git ]; then
|
if [ -d botlib/.git ]; then
|
||||||
git -C botlib pull --ff-only origin main
|
git -C botlib pull --ff-only origin main
|
||||||
else
|
else
|
||||||
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git botlib
|
git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git botlib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Clone or update botserver
|
||||||
if [ -d botserver/.git ]; then
|
if [ -d botserver/.git ]; then
|
||||||
git -C botserver pull --ff-only origin main
|
git -C botserver pull --ff-only origin main
|
||||||
else
|
else
|
||||||
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver
|
git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d /opt/gbo/data/gb-ws/.git ]; then
|
|
||||||
git -C /opt/gbo/data/gb-ws pull --ff-only origin main
|
|
||||||
else
|
|
||||||
git clone --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git /opt/gbo/data/gb-ws
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp /opt/gbo/data/gb-ws/Cargo.toml Cargo.toml
|
|
||||||
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
|
|
||||||
done
|
|
||||||
mkdir -p /opt/gbo/data/botserver/target
|
mkdir -p /opt/gbo/data/botserver/target
|
||||||
|
|
||||||
- name: Cache sccache
|
- name: Cache sccache
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue