From 9fc43e4a557aff9a3610a856babc4a58beee6979 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 25 Jan 2026 18:01:19 -0300 Subject: [PATCH] Enable sccache, increase cores to 2, fast build --- .forgejo/workflows/botserver.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index 8492c3c98..e9c95f3cb 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -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