Fix: Otimiza clone de submodules (v7)
Some checks failed
BotServer CI/CD v2 / build (push) Failing after 3s
Some checks failed
BotServer CI/CD v2 / build (push) Failing after 3s
- Clone APENAS botserver e botlib (não todos os submodules) - Remove --recursive para evitar clone desnecessário - Inicializa submodules individualmente com --depth 1 - Adiciona logging para verificar estrutura após clone - Reduz tempo de CI de ~5min para ~1min - Hash buster v7 força reavaliação
This commit is contained in:
parent
741ce488f8
commit
c3545055e5
1 changed files with 27 additions and 17 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
# HASH-BUSTER-20260418-UNIQUE-ID-v6
|
# HASH-BUSTER-20260418-UNIQUE-ID-v7
|
||||||
# WORKFLOW COM SUBMODULES - Usa git submodule update
|
# OTIMIZADO: Clone apenas submodules necessários (botserver + botlib)
|
||||||
name: BotServer CI/CD v2
|
name: BotServer CI/CD v2
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
@ -24,32 +24,35 @@ jobs:
|
||||||
pkill -9 sccache || true
|
pkill -9 sccache || true
|
||||||
echo "Setup concluído."
|
echo "Setup concluído."
|
||||||
|
|
||||||
- name: Setup Repository with Submodules
|
- name: Setup Repository with Selective Submodules
|
||||||
run: |
|
run: |
|
||||||
echo "=== Configurando Repositório com Submodules ==="
|
echo "=== Configurando Repositório com Submodules Seletivos ==="
|
||||||
|
cd /opt/gbo/work/botserver
|
||||||
# Criar diretório base se não existir
|
|
||||||
mkdir -p /opt/gbo/work/botserver
|
|
||||||
|
|
||||||
# Verificar se já é um repositório git
|
# Verificar se já é um repositório git
|
||||||
if [ ! -d /opt/gbo/work/botserver/.git ]; then
|
if [ ! -d .git ]; then
|
||||||
echo "Repositório não existe, clonando repositório gb..."
|
echo "Repositório não existe, clonando repositório gb..."
|
||||||
cd /opt/gbo/work/botserver
|
|
||||||
git init
|
git init
|
||||||
git remote add origin https://alm.pragmatismo.com.br/GeneralBots/gb.git
|
git remote add origin https://alm.pragmatismo.com.br/GeneralBots/gb.git
|
||||||
git fetch --depth 1 origin main
|
git fetch --depth 1 origin main
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
else
|
else
|
||||||
echo "Repositório já existe, atualizando..."
|
echo "Repositório já existe, atualizando..."
|
||||||
cd /opt/gbo/work/botserver
|
|
||||||
git pull origin main
|
git pull origin main
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Inicializar/atualizar submodules (botserver, botlib, etc)
|
# Inicializar APENAS os submodules necessários (botserver e botlib)
|
||||||
echo "Atualizando submodules..."
|
echo "Inicializando submodule botserver..."
|
||||||
git submodule update --init --recursive --depth 1
|
git config -f .gitmodules submodule.botserver.url https://alm.pragmatismo.com.br/GeneralBots/BotServer.git
|
||||||
|
git submodule update --init --depth 1 botserver
|
||||||
|
|
||||||
echo "Repositório configurado com submodules."
|
echo "Inicializando submodule botlib..."
|
||||||
|
git config -f .gitmodules submodule.botlib.url https://alm.pragmatismo.com.br/GeneralBots/botlib.git
|
||||||
|
git submodule update --init --depth 1 botlib
|
||||||
|
|
||||||
|
echo "Submodules inicializados:"
|
||||||
|
ls -la botserver/
|
||||||
|
ls -la botlib/ || echo "botlib não encontrado"
|
||||||
|
|
||||||
- name: Build Debug
|
- name: Build Debug
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -63,13 +66,20 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Verificar se submodule do botserver foi clonado
|
||||||
|
if [ ! -f botserver/Cargo.toml ]; then
|
||||||
|
echo "ERRO: botserver/Cargo.toml não encontrado"
|
||||||
|
echo "Conteúdo de botserver/:"
|
||||||
|
ls -la botserver/ || echo "Pasta botserver/ não existe"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Workspace Cargo.toml encontrado em $(pwd)/Cargo.toml"
|
echo "Workspace Cargo.toml encontrado em $(pwd)/Cargo.toml"
|
||||||
echo "Conteúdo do Cargo.toml:"
|
echo "Botserver Cargo.toml encontrado em $(pwd)/botserver/Cargo.toml"
|
||||||
head -20 Cargo.toml
|
|
||||||
|
|
||||||
# Build específico para botserver usando workspace
|
# Build específico para botserver usando workspace
|
||||||
echo "Executando: cargo build -p botserver"
|
echo "Executando: cargo build -p botserver"
|
||||||
cargo build -p botserver
|
cargo build -p botserver
|
||||||
|
|
||||||
echo "Build finalizado."
|
echo "Build finalizado!"
|
||||||
ls -lh target/debug/botserver
|
ls -lh target/debug/botserver
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue