fix(ci): sccache effective - incremental=1, touch only changed files

- CARGO_INCREMENTAL=1 enables sccache to cache Rust compilations
  (was 0, making all compilations non-cacheable)
- Only touch files that changed between old and new rev
  (was touching ALL files, invalidating entire sccache cache)
- Use git pull --rebase to avoid merge conflicts in CI
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-29 08:41:42 -03:00
parent 7177e64079
commit 45c5a2b2e5

View file

@ -16,14 +16,18 @@ jobs:
runs-on: gbo runs-on: gbo
env: env:
RUSTC_WRAPPER: sccache RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: "0" CARGO_INCREMENTAL: "1"
PATH: /home/gbuser/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/sbin:/bin PATH: /home/gbuser/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/sbin:/bin
steps: steps:
- name: Setup - name: Setup
run: | run: |
cd /opt/gbo/work/generalbots cd /opt/gbo/work/generalbots
git pull OLD_REV=$(git rev-parse HEAD)
git ls-files -z | xargs -0 touch -d "@$(git log -1 --format='%ct')" git pull --rebase || git rebase --abort && git reset --hard origin/main
NEW_REV=$(git rev-parse HEAD)
if [ "$OLD_REV" != "$NEW_REV" ]; then
git diff --name-only -z "$OLD_REV" "$NEW_REV" | xargs -0 touch
fi
git log --oneline -1 git log --oneline -1
- name: Build BotServer and BotUI - name: Build BotServer and BotUI