Enable sccache, increase cores to 2, fast build

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-01-25 18:01:19 -03:00
parent 73da9f29cb
commit 9fc43e4a55

View file

@ -7,7 +7,7 @@ on:
branches: ["main"]
env:
CARGO_BUILD_JOBS: 1
CARGO_BUILD_JOBS: 2
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
@ -30,7 +30,7 @@ jobs:
cd workspace
git submodule update --init --depth 1 botlib
git submodule update --init --depth 1 botui
rm .cargo/config.toml
# Remove missing members from workspace to prevent Cargo errors
sed -i '/"botapp",/d' Cargo.toml
@ -39,7 +39,7 @@ jobs:
cd ..
rm -rf workspace/botserver
mv botserver workspace/botserver
rm -f workspace/botserver/.cargo/config.toml
- name: Cache Cargo registry
@ -63,13 +63,23 @@ jobs:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install sccache
run: |
wget https://github.com/mozilla/sccache/releases/download/v0.8.2/sccache-v0.8.2-x86_64-unknown-linux-musl.tar.gz
tar xzf sccache-v0.8.2-x86_64-unknown-linux-musl.tar.gz
mv sccache-v0.8.2-x86_64-unknown-linux-musl/sccache $HOME/.cargo/bin/sccache
chmod +x $HOME/.cargo/bin/sccache
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_DIR=/opt/gbo/sccache" >> $GITHUB_ENV
- name: Setup environment
run: sudo cp /opt/gbo/bin/system/.env . 2>/dev/null || true
- name: Build debug
working-directory: workspace
run: |
cargo build -p botserver -p botui -j 1 2>&1 | tee /tmp/build.log
cargo build -p botserver -p botui -j 2 2>&1 | tee /tmp/build.log
ls -lh target/debug/botserver
ls -lh target/debug/botui