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:
parent
7177e64079
commit
45c5a2b2e5
1 changed files with 7 additions and 3 deletions
|
|
@ -16,14 +16,18 @@ jobs:
|
|||
runs-on: gbo
|
||||
env:
|
||||
RUSTC_WRAPPER: sccache
|
||||
CARGO_INCREMENTAL: "0"
|
||||
CARGO_INCREMENTAL: "1"
|
||||
PATH: /home/gbuser/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/sbin:/bin
|
||||
steps:
|
||||
- name: Setup
|
||||
run: |
|
||||
cd /opt/gbo/work/generalbots
|
||||
git pull
|
||||
git ls-files -z | xargs -0 touch -d "@$(git log -1 --format='%ct')"
|
||||
OLD_REV=$(git rev-parse HEAD)
|
||||
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
|
||||
|
||||
- name: Build BotServer and BotUI
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue