2026-04-18 18:03:31 -03:00
|
|
|
# HASH-BUSTER-20260418-CONTAINER-v13
|
|
|
|
|
# Uses container with full shell support
|
2026-04-18 17:27:23 -03:00
|
|
|
name: BotServer CI/CD
|
2025-12-16 13:25:26 -03:00
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2026-04-18 16:33:51 -03:00
|
|
|
branches: [main]
|
2026-04-18 16:11:27 -03:00
|
|
|
pull_request:
|
2026-04-18 16:33:51 -03:00
|
|
|
branches: [main]
|
2025-12-16 13:25:26 -03:00
|
|
|
|
2026-04-18 16:20:38 -03:00
|
|
|
env:
|
2026-04-18 17:27:23 -03:00
|
|
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
|
|
|
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
2026-04-18 16:20:38 -03:00
|
|
|
|
2025-12-16 13:25:26 -03:00
|
|
|
jobs:
|
|
|
|
|
build:
|
2026-04-18 16:20:38 -03:00
|
|
|
runs-on: gbo
|
2026-04-18 18:03:31 -03:00
|
|
|
container:
|
|
|
|
|
image: ubuntu:22.04
|
2025-12-16 13:25:26 -03:00
|
|
|
steps:
|
2026-04-18 18:03:31 -03:00
|
|
|
- name: Install Dependencies
|
|
|
|
|
run: |
|
|
|
|
|
apt-get update
|
|
|
|
|
apt-get install -y git curl ssh ca-certificates
|
|
|
|
|
|
|
|
|
|
- name: Setup Rust
|
|
|
|
|
run: |
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
|
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
|
|
2026-04-18 17:55:18 -03:00
|
|
|
- name: Clone Clean
|
2026-04-18 16:20:38 -03:00
|
|
|
run: |
|
2026-04-18 17:55:18 -03:00
|
|
|
echo "=== Clone Clean Workspace ==="
|
2026-04-18 17:27:23 -03:00
|
|
|
rm -rf /opt/gbo/work/build
|
|
|
|
|
mkdir -p /opt/gbo/work/build
|
|
|
|
|
cd /opt/gbo/work/build
|
|
|
|
|
git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git workspace
|
|
|
|
|
cd workspace
|
2026-04-18 18:03:31 -03:00
|
|
|
echo "Initializing submodules..."
|
2026-04-18 17:27:23 -03:00
|
|
|
git config -f .gitmodules submodule.botserver.url https://alm.pragmatismo.com.br/GeneralBots/BotServer.git
|
|
|
|
|
git config -f .gitmodules submodule.botlib.url https://alm.pragmatismo.com.br/GeneralBots/botlib.git
|
2026-04-18 17:22:44 -03:00
|
|
|
git submodule update --init --depth 1 botserver
|
|
|
|
|
git submodule update --init --depth 1 botlib
|
2026-04-18 17:55:18 -03:00
|
|
|
echo "Preparing Cargo.toml..."
|
2026-04-18 17:27:23 -03:00
|
|
|
grep -v '"botapp\|"botdevice\|"bottest\|"botui\|"botbook\|"botmodels\|"botplugin\|"bottemplates"' Cargo.toml > Cargo.toml.clean || true
|
|
|
|
|
if [ -s Cargo.toml.clean ]; then
|
|
|
|
|
mv Cargo.toml.clean Cargo.toml
|
|
|
|
|
fi
|
2026-04-18 16:20:38 -03:00
|
|
|
|
2026-04-18 17:27:23 -03:00
|
|
|
- name: Build
|
2026-04-18 16:20:38 -03:00
|
|
|
run: |
|
2026-04-18 18:03:31 -03:00
|
|
|
echo "=== Build ==="
|
2026-04-18 17:27:23 -03:00
|
|
|
cd /opt/gbo/work/build/workspace
|
2026-04-18 17:45:41 -03:00
|
|
|
cargo build -p botserver
|
2026-04-18 17:09:03 -03:00
|
|
|
ls -lh target/debug/botserver
|
2026-04-18 17:27:23 -03:00
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
|
run: |
|
|
|
|
|
echo "=== Deploy ==="
|
2026-04-18 18:03:31 -03:00
|
|
|
echo "Deploy step placeholder"
|