fix: Update CI workflows for monorepo structure
- Fix all workflows to use /opt/gbo/work/generalbots (monorepo) - Add proper env vars (SCCACHE, CARGO_TARGET_DIR, PATH) to all workflows - Add deploy steps for botui (with process restart) - Remove broken workflows for non-Rust packages (botapp, botbook, botdevice, botmodels, botplugin) - Add botlib test workflow
This commit is contained in:
parent
5ab886e6e3
commit
b537b021c4
9 changed files with 91 additions and 118 deletions
|
|
@ -1,16 +0,0 @@
|
||||||
name: Botapp CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- 'botapp/**'
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: gbo
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd /opt/gbo/work/botapp
|
|
||||||
git reset --hard HEAD && git clean -fd
|
|
||||||
git pull
|
|
||||||
cargo build
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
name: Botbook CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- 'botbook/**'
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: gbo
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd /opt/gbo/work/botbook
|
|
||||||
git reset --hard HEAD && git clean -fd
|
|
||||||
git pull
|
|
||||||
cargo build
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
name: Botdevice CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- 'botdevice/**'
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: gbo
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd /opt/gbo/work/botdevice
|
|
||||||
git reset --hard HEAD && git clean -fd
|
|
||||||
git pull
|
|
||||||
cargo build
|
|
||||||
26
.forgejo/workflows/botlib.yaml
Normal file
26
.forgejo/workflows/botlib.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
name: Botlib CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'botlib/**'
|
||||||
|
- '.forgejo/workflows/botlib.yaml'
|
||||||
|
env:
|
||||||
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
||||||
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: gbo
|
||||||
|
steps:
|
||||||
|
- name: Setup
|
||||||
|
run: |
|
||||||
|
cd /opt/gbo/work/generalbots
|
||||||
|
git reset --hard HEAD
|
||||||
|
git clean -fd
|
||||||
|
git pull
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
cd /opt/gbo/work/generalbots
|
||||||
|
cargo test -p botlib
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
name: Botmodels CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- 'botmodels/**'
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: gbo
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd /opt/gbo/work/botmodels
|
|
||||||
git reset --hard HEAD && git clean -fd
|
|
||||||
git pull
|
|
||||||
cargo build
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
name: Botplugin CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- 'botplugin/**'
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: gbo
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd /opt/gbo/work/botplugin
|
|
||||||
git reset --hard HEAD && git clean -fd
|
|
||||||
git pull
|
|
||||||
cargo build
|
|
||||||
|
|
@ -3,10 +3,10 @@ on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'botserver/**'
|
- 'botserver/**'
|
||||||
- 'botlib/**'
|
- 'botlib/**'
|
||||||
- 'Cargo.lock'
|
- 'Cargo.lock'
|
||||||
- '.forgejo/workflows/botserver.yaml'
|
- '.forgejo/workflows/botserver.yaml'
|
||||||
env:
|
env:
|
||||||
SCCACHE_DIR: /opt/gbo/work/.sccache
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
||||||
CARGO_TARGET_DIR: /opt/gbo/work/target
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
||||||
|
|
@ -16,22 +16,22 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
cd /opt/gbo/work/generalbots
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git pull
|
git pull
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
cd /opt/gbo/work/generalbots
|
||||||
cargo build -p botserver
|
cargo build -p botserver --bin botserver
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
|
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
|
||||||
mkdir -p /opt/gbo/bin
|
mkdir -p /opt/gbo/bin
|
||||||
cp -f /opt/gbo/work/generalbots/target/debug/botserver /opt/gbo/bin/
|
cp -f /opt/gbo/work/generalbots/target/debug/botserver /opt/gbo/bin/
|
||||||
chmod +x /opt/gbo/bin/botserver
|
chmod +x /opt/gbo/bin/botserver
|
||||||
cd /opt/gbo/bin && ./botserver --noconsole &
|
cd /opt/gbo/bin && RUST_LOG=info nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2> /opt/gbo/logs/stderr.log &
|
||||||
sleep 3
|
sleep 5
|
||||||
pgrep -x botserver && echo "✅ BotServer Deployed" || echo "❌ Failed"
|
pgrep -x botserver && echo "BotServer Deployed" || echo "Failed"
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,24 @@ on:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'bottest/**'
|
- 'bottest/**'
|
||||||
|
- 'botlib/**'
|
||||||
|
- '.forgejo/workflows/bottest.yaml'
|
||||||
|
env:
|
||||||
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
||||||
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
steps:
|
steps:
|
||||||
- name: Build
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/bottest
|
cd /opt/gbo/work/generalbots
|
||||||
git reset --hard HEAD && git clean -fd
|
git reset --hard HEAD
|
||||||
git pull
|
git clean -fd
|
||||||
cargo build
|
git pull
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
cd /opt/gbo/work/generalbots
|
||||||
|
cargo test -p bottest
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,32 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- 'botui/**'
|
- 'botui/**'
|
||||||
- 'botlib/**'
|
- 'botlib/**'
|
||||||
|
- '.forgejo/workflows/botui.yaml'
|
||||||
|
env:
|
||||||
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
||||||
|
CARGO_TARGET_DIR: /opt/gbo/work/target
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
steps:
|
steps:
|
||||||
- name: Build
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/botui
|
cd /opt/gbo/work/generalbots
|
||||||
git reset --hard HEAD && git clean -fd
|
git reset --hard HEAD
|
||||||
git pull
|
git clean -fd
|
||||||
cargo build
|
git pull
|
||||||
- name: Deploy
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
echo "BotUI deployed"
|
cd /opt/gbo/work/generalbots
|
||||||
|
cargo build -p botui --bin botui
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
timeout 5 bash -c 'while pgrep -x botui > /dev/null; do pkill -x botui; sleep 0.5; done' || true
|
||||||
|
mkdir -p /opt/gbo/bin
|
||||||
|
cp -f /opt/gbo/work/generalbots/target/debug/botui /opt/gbo/bin/
|
||||||
|
chmod +x /opt/gbo/bin/botui
|
||||||
|
cd /opt/gbo/bin && RUST_LOG=info nohup ./botui --noconsole >> /opt/gbo/logs/stdout.log 2>> /opt/gbo/logs/stderr.log &
|
||||||
|
sleep 3
|
||||||
|
pgrep -x botui && echo "BotUI Deployed" || echo "Failed"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue