From 3a027e6619e0c40fd42cb65379374ddd99a9da7b Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Fri, 17 Apr 2026 19:45:18 -0300 Subject: [PATCH] Fix CI workflow to cache dependencies and preserve workspace between runs --- .forgejo/workflows/botserver.yaml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index 60336fcb..db5c6c8a 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -16,17 +16,29 @@ jobs: run: | set -e - # Clean and setup - rm -rf ~/workspace ~/gb-ws - mkdir -p ~/workspace/target - mkdir -p ~/cache + # Setup directories + mkdir -p ~/workspace ~/cache cd ~/workspace - # Clone fresh - git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git - git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver - git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git ~/gb-ws + # Clone or update repos + if [ ! -d botlib ]; then + git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git + else + cd botlib && git pull && cd .. + fi + + if [ ! -d botserver ]; then + git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver + else + cd botserver && git pull && cd .. + fi + + if [ ! -d ~/gb-ws ]; then + git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git ~/gb-ws + else + cd ~/gb-ws && git pull && cd ~/workspace + fi # Setup Cargo.toml cp ~/gb-ws/Cargo.toml ~/workspace/Cargo.toml